similar to: Parameters for FormOptionsHelper select vs. FormTagHelper select_tag

Displaying 20 results from an estimated 1000 matches similar to: "Parameters for FormOptionsHelper select vs. FormTagHelper select_tag"

2006 Jun 24
1
select or select_tag ?
hello PPL, I''ve seen now that the _form.rhtml generated by script/scaffold is populated by <%= text_field ''model'', ''field'' %> without _tag! but only text_field_tag is to be found in the 1.1.2 documentation.. (like in the rest of Module ActionView::Helpers::FormTagHelper there is _tag) I''ve tried to use <%= select instead of
2006 Jun 28
6
select_tag
in my controller @cursos = Curso.find_all in my view i''m trying to do a select_tag with the results @cursos, using a helper select_tag "name" options_for_select(@cursos) --------> not works select_tag "name" @cursos --------> not works how to do it, using the helper? tks -- Posted via http://www.ruby-forum.com/.
2009 Mar 11
1
NoMethodError for select_tag
Hello there. I am following a tutorial with rails 2.1 and I have come across a problem where <%= f.label :artist_id %><br /> <%= f.select_tag(:artist_id, options_for_select([[''choose one'', '''']] + @artists.collect {|art| [art.name, art.id]}, @album.artist_id)) %> (Old artist info:<%= @album.artist_old%>) gives undefined method
2008 Apr 05
2
model select and non-model select_tag
Hello everyone, I''m just trying to understand some logical reasons behind Rails syntax of "select" and "select_tag". I know I can do this: <%= form.select :card_type, supported_card_types, { :prompt => "Please Select..."} %> which sets a model field in the params hash. If I want to do the same for a non-model field,
2006 Oct 25
1
Help with a select_tag; getting an undefined method `stringify_keys' error
Hi, I''m trying to use a select_tag in the following manner: <%= select_tag(:received_at, @select_dates, String(params[:received_at]) ) %> But I get this error: undefined method `stringify_keys'' for "":String Removing the third parameter eliminates the error, but I was hoping that the drop-down list will select whichever string in the drop-down list matches
2006 Jan 19
2
select vs. select_tag
I have a "Users" object and a "Timesheets" object. Each timesheet entry belongs to a User, which is selected from a drop-down list. The timesheet has a user_id field. (The user needs to have an option to select a different user due to the way our system works.) If i use the "select" object, which is bound to the Timesheet model, using this code: &lt;%= select
2008 Sep 02
1
seledted option for select_tag
Hi iam using select_tag i want selected_option. i have made select _tag like this <%=select_tag(''name'', options_for_select({ :Relevance =>''Relevant'',:Date=>''Recent''}),:selected=>params[:name].to_s) %> The generated html look like this <select selected="Relevant" name="name"
2008 Apr 24
2
select_tag and link_to
Does ROR allow passing the chosen value from a drop down using select_tag into link_to ? Basically I want to do something like: <%= select_tag( "name", options_for_select(%w{John Doe Jane })) %> <%= link_to "Delete", { :controller => "myname", :action => "add", :id => name },
2007 Jan 25
2
React on select_tag (onchange)
Hi, I''m new in developint rails (but I love rails). I would like to react on changing a field in the view (no model field) from a selection box to show the number of rows (which I used in the controller). In the controller I read the params-hash: ... @rowsperpage = params[''rowsperpage''].to_i ... In the view I have the field, where I like to react directly. ...
2007 May 24
3
Help with Create and Update with options_for_select in a select_tag
I have a select_tag in my view that uses options_for_select with multiple = true. I am having trouble figuring out the Rails way to create and update that field. Please help. Models: ------------- Service has_many AccessControl AccessControl belongs_to Service application.rb ------------------------- $types = Array["Athens", "htpasswd", "IP", "None",
2006 Apr 19
2
select_tag and :include_blank => true not working
Guys, I''m using select_tag to display a non-model dropdown, which works fine. However, I''ve tried every which way to use the :include_blank => true option, but it simply won''t display a blank value. Using :include_blank => true with select on model fields works fine. Can someone please show me a working example? -- Posted via http://www.ruby-forum.com/.
2005 Nov 22
3
non model select_tag problem
What am I doing wrong here: select_tag(''website_ids[]'', options_from_collection_for_select(Website.find_all, ''id'', ''name'', params[:website_ids]), {:multiple => true, :size => 5}) It works fine except that it does not display the selected options once the form is submitted (it submits to the same page). The
2010 Mar 22
7
How to reference a select_tag within a form
Hi All, Inside my app\views\expenses\new.html.erb file, I had the code: <% form_for(@expense) do |f| %> [snip] <p> <%= f.label :vendor %><br /> <%= f.text_field :vendor %> <br /> <div id="vendor_droplist> <%= select_tag "test", options_for_select(@current_vendors.collect { |v| v.nickname }), {:multiple
2006 Apr 11
5
multiple select_tag
Hello again, I have a table called line_items, with the following fields: id int item_name varchar() qty int conditions text I''ve made my LineItem model, and everything works as such (with simple text_fields).. Now I''d like for the conditions field to be a select_tag() with multiple choice possibility. I''m guessing I need some code to expand/restract the array for
2011 Apr 29
2
change patial with change of the item in a select_tag
hi, i would like to change a partial in my view with the change of the item in a select_tag: in the view: <%= observe_field("payment_id", :url => {:controller =>''user_admins'' ,:action => ''rend_part''},:on => ''change'', :frequency => 0.1) %> <%= select( "payment", "id", { "Visa"
2008 Jan 03
1
Help using options_for_select in select_tag
<b>Client</b><br /> <%= select_tag ''clients[]'', options_for_select( [['' '',''1''], [''aaaa'',''2''],
2006 Apr 05
1
FormTagHelper form names: possible?
Thank you to everybody that has helped me since I signed up. I''m flying along thanks to you. I have a question about the FormTagHelper "start_form_tag": I''ve been trying to figure out how to get Rails to output a "name" attribute for my form so I can hook in a Javascript to focus on a field inside of it on load, but it doesn''t look like I can do
2010 Dec 22
1
'No route matches' error with select_tag
Rails 3: I have a view books/:id/show.html.erb - in the view, I have a form with a select tag to pick a template, that on dropdown should submit the form which rerenders the page based on the selection: <%= form_tag book_path(@book) do %> > > <%= select_tag "template[]", >> options_for_select([["Template1","template1"], ["Template2",
2011 Oct 05
3
Rails 3 Select_tag in javascript give missing ; error
When I write var x = "<%= select_tag(:activity_group, options_for_select(activity_grp),{:include_blank => ''Create New Group'', :style => ''width: 100px''}) %>"; where <% activity_grp = @activity_group.map { |ag| [ag.name, ag.id] } %> However, I get error (missing ; before statement) in Firebug because var x = "<select
2006 Dec 19
0
Calling FormOptionsHelper select method in controller
All, I know that it is _wrong_ for me to do it, but I would like to know what is the easiest way for me to call the select() method in ActionView::Helpers::FormOptionsHelper from within a controller? Thanks, Wes -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby