search for: label_method

Displaying 2 results from an estimated 2 matches for "label_method".

2012 Jan 24
4
:locals does not pass var in rails 3.1.0 partial view
...%= render :partial => ''standards'', :locals => { :f => f, :sid => r.id } %></p> <% end %> Here is the standards partial view: <%= f.association :standards, :collection => Standard.active_std.all(:order => ''name''), :label_method => :name, :value_method => :id, :prompt => "Choose std", :label => "standard:", :include_blank => true, :selected => sid %> When standards rendered, there is an error saying that var or method not defined. Any thoughts about the problem? thanks. -- You r...
2014 Apr 19
0
How to has_one/belongs_to association only return the objects unassociated in combobox?
I have two models (Car and Driver) and a combobox to select which driver belongs to which car. I want the combobox just show the objects that have not yet been associated. # vehicle belongs_to: driver # driver has_one: vehicle # simple_form # vehicle/_form.html.haml = f.association: driver, label_method: :name, value_method: :id How to ensure validation before saving, to avoid problems of concurrent accesses? Thanks -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it...