similar to: select :selected doesn''t actually generate a selected option

Displaying 20 results from an estimated 4000 matches similar to: "select :selected doesn''t actually generate a selected option"

2009 Jan 28
1
How to give onchange for select_year rails helper....
<%=select_year(Date.today,:include_blank=>true, :start_year => Date.today.strftime("%Y").to_i, :end_year => 1999)%> i am using rhis helper... now i want to give onchange here.... Please help me to solve this .... thanks in advance JK -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because
2008 Feb 26
2
Specify HTML options on select_year
Rails 1.2.3 It appears that the select_year helper doesn''t accept HTML attributes as part of the options array. Does anyone have a way to successfully pass an :onchange attribute in to the select_year helper? I''m going to do it with Javascript directly for now. Thanks, Wes -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You
2008 Jun 26
2
Problem with date_select after Rails 2.1 upgrade
Folks, I think I should start a new thread for this, because a similar one I saw is a bit old and the resolution there doesn''t seem to apply to what I''m running into now. Anyway, my date_select calls are bombing on me with the exception: ---- ActionView::TemplateError (wrong number of arguments (3 for 2)) on line #8 of entries/_dates_form.haml: 8: = date_select(
2005 May 08
3
Overriding date_select in local project to use custom value rather than blank for starting option...
I would like to have a date control on a page and I would like a behavior similar to what you get using date_select with the :include_blank => true option where the first value in the dropdown is "- Month -", "- Day -", or "- Year -" rather than a blank value for the respective month, day, and year select fields. I took a look at the ruby source for
2006 Apr 10
9
Pagination with letter (A B C D ... Z)
Hi there, Is there a neat and easy way to implement pagination with letters rather than numbers eg : A B C D ... Z Rob
2006 Apr 05
7
select_tag - populating options
Hello, I want to a select tag, where you can choose a number between 1 and 100. My inital code is based on the examples from Agile Web Development with Rails, and looks like this: view: <%= options = [["Select number of lines", ""]] + RfqLines::LINE_QTY select("rfq_line", "line_qty", options) %> model: LINE_QTY = select_fill def
2006 Feb 21
4
Select error
This code: <p> <label for="resource_type">Type</label><br/> <%= select(:resource, :type, %w{ Web Data }, { :include_blank => true }) %> </p> Produces this error: TypeError in Resources#new Showing app/views/resources/_form.rhtml where line #6 raised: wrong argument type String (expected Module) Extracted source (around line
2006 Feb 05
0
How can i specify default time to datetime_select tag
I want to specify a different default time to datetime_select tag how can i do that. also i was looking at rails helper code ----------------------------------------------------------------------- module ActionView module Helpers module DateHelper def to_datetime_select_tag(options = {}) defaults = { :discard_type => true } options = defaults.merge(options)
2006 Apr 06
6
select method
The documentation states as an example: select("post", "person_id", Person.find_all.collect {|p| [ p.name, p.id ] }, { :include_blank => true }) could become: <select name="post[person_id]"> <option></option> <option value="1" selected="selected">David</option> <option
2005 Dec 12
1
Search screens with dates
Tried googling and searching the lists for this. I''d like to do a search on some dates and naturally enough use the date helpers. I have a number of problems: -- datetime_select wants an active record model -- select_datetime does not take the options that datetime_select take - specifically :order that leaves me with something like <label>Date/Time
2006 Jun 25
3
select box''s
Hi, I have this code for a select box, <%= select("plugin", "plugcats", Plugcats.find_all.collect {|p| [ p.title, p.id ] }, { :include_blank => true }) %> at the minute it extracts teh requried data, but submits the data as params[''plugin''][''plugcats''] how can I get it to submit it as
2006 May 18
4
Problems using ''select''
I use :filter action to display form and allow record filtering. It contains form with combo box, submit button and list of record matching value in combo. filter.rb: class Filter attr_accessor :owner def initialize(params) @owner = ''''; if !params[:filter].nil? and params[:filter].has_key?(:owner) @owner = params[:filter][:owner] end end end Controler: @users =
2007 Aug 10
2
Select doenst pass the correct value
Hello, I have in my view a select tag that doesnt return the right value, could anyone point me what am I doing wrong? Heres whats in my view <%=select "", "situacao", {"Open"=>0,"Closed"=> 1},:include_blank=>true%> Then in my controller I do this def status if request.post? #Do some stuff @situacao = params[:situacao]
2006 Aug 09
2
how to access selected value in controller action
I have this in a view: <%= start_form_tag :action => ''create_price'', :id => @media.id %> <%= select("media", "price_code_id", PriceCode.find_all.collect {|pc| [pc.name, pc.id ] }, { :include_blank => false }) %> <%= submit_tag ''Add Price Code'' %> <%= end_form_tag %> My question is, how would I access the
2006 Jun 17
2
problem with select_date
In my form I have these items: <%= select_year Date.today, :start_year => Schoolyear.get_startdate.year, :end_year => Schoolyear.get_enddate.year %> <%= select_month Date.today.month %> No matter what I do, in my controller I can''t seem to access the selected year and month. I have tried params[:month].to_s and also
2006 Apr 27
4
select item based on previous select list selection?
So I have a select list with a list of items. When a user selects an item, another select list should have its default selected item set to a specific item (the default associated with the first select list). This is in a form to create a new task. The first select list is a list of parent tasks. When one selects the parent task, the clients select list must default to the same client as its
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/.
2006 Jul 02
6
remote form w/ evalScripts:true
Hello. I want to select an item from a select list and have that result in an ajax call that updates two sections on the page. Here is the code in the controller def create ... render :update do |page| page.replace_html ''list_items'', :partial => ''lists/list_items'' page.replace_html ''add_item'', :partial =>
2008 Jul 04
4
Routing and Parameters
Greetings. I have a route something like this: map.calendar ''/tasks/:year/:month'', :controller => ''tasks'', :action => ''calendar'', :year => /\d{4}/, :month => /\d{2}/ (Ignore the obvious problems of invalid data.) I''m trying to create a form that will allow my users to navigate from one month/year to the next.
2005 Dec 23
2
Bizarre problems with AJAX / missing variables
I''m having some really weird problems with an app I''m writing. Everything is working as expected on my development machine (OSX, Rails 0.14.4) but is cacking out with weird errors on the Textdrive demo site (FreeBSD, Rails 1.0.0). It complains about missing variables, with errors like this: undefined local variable or method `rawcode'' for