similar to: Passing parameters to before_filter methods

Displaying 20 results from an estimated 300 matches similar to: "Passing parameters to before_filter methods"

2006 Feb 20
1
Using :except or :only on a before_filter block
Hi all, How do you use :except or :only conditions on a filter block? I can''t seem to work out the syntax! I''m currently doing: before_filter { |c| c.role_required ''admin'' } Thanks a lot! Tom
2005 Nov 18
10
[Request] file_column configurability
I wasn''t sure where to email this request, so I am hoping the author of file_column actually sees this. I was wondering if there were any plans to allow some configurability in the file_column plugin. By configurability I mean allowing the developer to define which table column is used as the unique identifier when creating image folders. Right now it seems like it uses the ID of the
2006 Feb 03
6
Rails from the command line
I have controller that processes data in one table and puts results in another. Now that its'' working, I would like to be able to run it from the command line ( read: windows batch file). How can this be done? It will be installed on a Windows box with InstantRails1.0, (if that matters). I will be doing more processes like this, so this is a good opportunity to get it right. -- Best
2005 Dec 23
10
Extending model
Hi, I''m looking for a way to extend one of my models to allow some level of abstraction between what goes into it and how it is stored. For example, say I have a Product and I want to set it''s price. A person using the website will type the price in euros. Internally, I''d like to store the price as an integer value of cents. I can currently do this with some ugly code
2006 Feb 04
3
I just can''t figure it out !
Howdy RailsWarriors, Its probably dead easy but I don''t see it. Got this in my controller. def new_computer User.find(params[:id]).computers.create(:comp => ''New Comp:'') end Which with an .rjs template creates a div at the bottom of my list. This all works like a charm. But in the partial I load in my rjs I also have a button for ''delete'' in the
2006 Jan 31
6
How to Affect Plugin Load Order
I''m using bundled_resource, login_engine, and a few other plugins. It appears Rails considers plugins in alphabetic order. Turns out that there is a particular order that will work and alphabetic ain''t it. The login engine must be loaded first. Bundled resource then includes ''application_helper'' and the application helper includes LoginEngine. If
2006 Jan 30
2
:condition not being applied
I am using acts_as_taggable and everything seems to be working except that :condition => "tags_resources.portal_id=#{portal_id}" is not being applied. @resource_pages = Paginator.new self, Resource.find_tagged_with(:any => tag, :condition => "tags_resources.portal_id=#{portal_id}").length, 25, @params[''page'']; @resources
2006 Jul 05
2
RJS - Getting and Setting Form Element Values Question
I''m still a beginner with RJS so forgive me if this is a simple one - but certainly it doesn''t seem logical and googling has not led to . Given a field with an id of ''posting_subject'' I can do the following in my controller with RJS. render :update do | page | subject = ''this is really something
2005 Dec 15
6
passing parameters to link_to OR better way to do this?
Hi All: I''m writing my 1st Rails app and I can''t seem to find the answer on the web or in the book. I''m making a table, and I want to be able to expand a filename. The code is basically as as follows below. In the last <td> entry, I want to call an action and pass in the test_results_path, which I will go and read a file and munge the data for a separate
2009 May 01
5
Layout antics
I have a strange problem with my layout file. I think it may be due to nested partials, but removing the deepest nested partial call does not clear the problem. I have an application wide layout (application.html.erb) that works as expected - loads images, javascript, css etc for my application. So http://localhost:3000/patients --> fine http://localhost:3000/patients/new --> fine
2005 Mar 23
2
0.11 problems
I''ve upgraded to 0.11 this morning specifically to test out the pagination stuff. When that didn''t work (didn''t recognise the command) I deleted my project and recreated from scratch. So in short rails projectname cd projectname edit config/database.yml (my database is postgres by the way) ruby scripts/generate model Recordtype ruby
2005 Dec 16
4
Adding extra value to an object
Hello friends , I have a clear method here :: def create @invoiceitems = Invoiceitems.new(params[:invoiceitems]) @invoiceitems["invoice_id"] = params[:id] if @invoiceitems.save flash[:notice] = ''Invoiceitems was successfully created.'' redirect_to :action => ''new'',:id => params[:id] else render :action =>
2005 Apr 20
4
acts_as_list and single table inheritance
in a single table inheritance model, rails will automatically set the scope for acts_as_list to the ''type'' field as well as any other scope conditions we provide. Is there a way to disable this? i want to use STI but I want acts_as_list to disregard the class type when getting/setting positions. thanks alan
2006 Feb 02
4
ajax insertion into a form
After an ajax insertion in the dom, it seems the browser don''t refresh its knowledge of the page. The source of the page is identical after the insertion, whereas the display is correct. The ajax insertion is used to add an input field. The added fields are ignored by the submission of the form. Isn''t it possible to do that, or maybe there''s a problem in my code
2006 Feb 05
30
Emacs rails.el
Features: * Management WEBrick - start, stop * Viewing log files * Abbrev from TextMate * Switching between View/Action http://www.emacswiki.org/cgi-bin/emacs/rails.el
2005 Dec 27
3
What is the best way of setting up the following model:
Hi, I am new to Rails (and Ruby) and for what i have seen sofar i like it a lot! But i can''t figure out what the best sollution would be for the following: Lets say i want to setup a CRM system and i have to sorts of contacts: Customers and Prospects. A part of the info is the same (addresses, company info etc) for both customers an prospects and a part is different. What i would
2007 Nov 10
1
File Server Security
Hello all I''ve been reading the security details at http://reductivelabs.com/trac/puppet/wiki/FileServingConfiguration#Security Can I confirm that even with "allow *", it will still only be clients who have had their certs signed by the puppet server who will be allowed access? Either way, it might be a good idea to clarify this in the documents. Many thanks Ian J Cottee
2004 Sep 10
1
Off Topic: Thanks to all flac developers!
Thank you all for working so hard to create FLAC. You guys are incredible! Sorry for posting to the dev list, but I couln't find any emails. Gerret Swearingen Houston, TX
2006 Jan 28
1
RailsCron 0.2 questions
Hi all, I''ve set up RailsCron to send email reminders on a daily basis. My dev environment is Rails trunk on Debian Sarge, lighttpd running as a regular user. I''m having two issues: 1) When I run "rake cron_start", I get rake aborted! undefined method `blank?'' for "":String The "blank?" method is provided by Rails, so I''m
2006 Jan 29
15
Reload the lib directory
Im writing a module in the lib directory. If I change the module, the changes are not visible to the application when i releod the web page (i am in the development evironment). I must restart the web server (WEBrick) and so i see the changes... but I lost more time. How can I reload the module in the dirictory lib, without reload WEBrick? Thanks so much --Reis -- Posted via