search for: simple_form_for

Displaying 7 results from an estimated 7 matches for "simple_form_for".

2012 Aug 07
9
How do I force link_to/form helpers to use the superclass name in the path instead subclass?
I want my helpers to generate paths using a superclass instead of the subclasses. Assuming I have Owner and Member that both inherit from User, rails will use the current objects class name when generating paths: Let''s say current_user is a mod: <%= link_to current_user.name, current_user %> will generate "/mod/:id". I want to force it to generate
2011 Jul 25
1
3 models in a form.
...::Base has_many :deliveries class Delivery < ActiveRecord::Base has_many :delivery_items has_many :products, :through => :delivery_items belongs_to :customer class DeliveryItem < ActiveRecord::Base belongs_to :delivery belongs_to :product I create a new delivery for customer x: = simple_form_for @customer do |f| = f.simple_fields_for :deliveries do |deliveries_f| .block .column.span-12 = deliveries_f.association :products, :multiple => true, :selected => @products_selected_id, :input_html => { :title => "- Select product -&...
2011 May 03
0
Simple_Form and Simple_Fields_For and working in Form_Tag, Fields_For
...want: <%= form_tag(update_individual_photos_path, :method => "put") do %> <%= fields_for "photos[]", @photo do |f| %> ................. <% end -%> <%= submit_tag("Post") %> <% end %> But i would like to move to doing this with simple_form_for and simple_fields_for but i cant get it working. Looks like simple_fields_for cant work with "photos[]", @photo ? Is it possible to call Simple_Fields_For with the same syntax as Fields_For ? -- You received this message because you are subscribed to the Google Groups "Ruby on Rai...
2011 Sep 01
0
do you think it's the best solution?
I have: class Shop < ActiveRecord::Base has_many :documents, :dependent => :restrict has_many :roles, :dependent => :restrict accepts_nested_attributes_for :documents accepts_nested_attributes_for :roles the shop _form is: = simple_form_for(@shop) do |shop_f| = render ''shared/error_messages'', :object => @shop = render :partial => ''document_fields_form'', :locals => { :f => shop_f } if @shop.new_record? or @document = field_set_tag t(''shop'') do .inputs = shop_f...
2012 Feb 26
0
how to get the index of the element passed to the render view ?
I am displaying a collection of expenses in a form the view in which the fom is displayed : ... = simple_form_for(@project, :html => {:class => ''form-stacked'' }) do |f| - unless @project.expenses.count > 0 No expenses - else #expenses = f.fields_for :expenses do |f| = render "backoffice/projects/expense_fields", :f => f .clearfix...
2012 Oct 09
0
Form Design issue - How to handle a parent association input..
...arent Place association class Event < ActiveRecord::Base belongs_to :place accepts_nested_attributes_for :place attr_accessible :place_attributes In a new event registration form, the user should have the choice to : - select from an existing Place - enter a new Place in a nested form = simple_form_for @event = f.association :place, :collection => Place.all(:order => ''label''), :prompt => "Choose an Place", :label => false .. = f.simple_fields_for :place do |pf| #geolocation.form-inputs = pf.simple_fields_for :geolocation...
2013 Jan 04
0
Add data in between Simple Form association members
Hey there, I am trying to use Simple Form''s association to list a bunch of radio buttons like so: <%= simple_form_for(@applicant) do |f| %> <%= f.association :track, :as => :radio_buttons %> <% end %> Assuming each track has many courses, how can I take every track from that association and loop over its courses to display them below the radio button? After all applicants need to kno...