search for: add_default_name_and_id

Displaying 6 results from an estimated 6 matches for "add_default_name_and_id".

2006 Aug 18
0
Why is select helpers not using options in add_default_name_and_id ?
Hello, In actionpack/lib/action_view/helpers/form_options_helper.rb (trunk) @ ~296 in the def to_select_tag(choices, options, html_options) function, why is there add_default_name_and_id(html_options) instead of add_default_name_and_id(options) This is inconsistent with the non-select helpers where add_default_name_and_id always use options. Is there a special reason for this? Furthermore, non-select helpers seem to always "stringify" all options and html_options be...
2008 Aug 14
0
facebook_form_builder.rb - add_default_name_and_id
...l called SignUp with a couple of text_fields and a datetime_select. When I was trying to build a form using the facebook_form_for helper, I realized that the controller was getting values from datetime_select correctly but was missing data from the text fields. I narrowed down the issue to add_default_name_and_id method and when changed it from def add_default_name_and_id(options,method) options[:name] = "#{object.class.name.downcase}[#{method}]" options[:id] ||= "#{object.class.name.downcase}_#{method}" end to def add_default_name_and_id(optio...
2006 Jul 08
10
A rant about parameters
...straight? Compounding the problem (and confusing me) was this method further down in the call stack: ---- module ActionView::Helpers class InstanceTag def to_country_select_tag(priority_countries, options, html_options) html_options = html_options.stringify_keys add_default_name_and_id(html_options) content_tag("select", add_options(country_options_for_select(value, priority_countries), options, value), html_options) end end end ---- Can anyone tell me how value here could *ever* have a value? Thanks for listening. I feel better somehow, but...
2007 Feb 28
1
Rails 1.2 Bug (?): to_text_area_tag
...s clear and helps somewhat. I''m not sure that this is the proper solution, but it does seem to be a legitimate issue. Below is the code for my new to_text_area_tag: def to_text_area_tag(options = {}) options = DEFAULT_TEXT_AREA_OPTIONS.merge(options.stringify_keys) add_default_name_and_id(options) if size = options.delete("size") if size.kind_of? Fixnum options["cols"] = size options["rows"] = size else options["cols"], options["rows"] = size.split("x")...
2006 Mar 01
3
Form helpers and overloaded methods - help!
Can someone explain why form helpers appear to bypass any model methods I override for fields that are bound to database fields? It would be great if someone could tell me how to force the form field, etc to call the method instead of looking at the database / attributes collection. Let''s say I have a column called ''price'' in my database table "books"
2006 May 18
3
populating array of text_fields from an array of model objects
I have in my view the following: <% 0.upto(@num_performances) do |idx| -%> <%= text_field ''performance'', ''city'', :index => idx, %> <%= text_field ''performance'', ''venue'', :index => idx, %> <% end -%> and in my controller I have: @performance = [Performance.new("city" =>