Hi all I am using rails 2.3.5. But I am facing the problem with date_select tag. I have written code as follow. = date_select :post, :birthdate, :start_year => 1950, :end_year => Date.today.year, :prompt => { :day => ''Select day'', :month => ''Select month'', :year => ''Select year'' } But I got error like "wrong number of arguments (2 for 1)". If I write only = date_select :post, :birthdate than also I got the same error. I have tried like date_select :post than it gives me error like "wrong number of arguments (1 for 2)". Help me out..... -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Fri, 2010-01-29 at 05:53 +0100, Smit Shah wrote:> Hi all > I am using rails 2.3.5. But I am facing the problem with date_select > tag. I have written code as follow. > > = date_select :post, :birthdate, :start_year => 1950, :end_year => > Date.today.year, :prompt => { :day => ''Select day'', :month => ''Select > month'', :year => ''Select year'' } > > But I got error like "wrong number of arguments (2 for 1)". If I write > only > = date_select :post, :birthdate > than also I got the same error. > > I have tried like > date_select :post > than it gives me error like "wrong number of arguments (1 for 2)". > > Help me out.....---- http://api.rubyonrails.org/classes/ActionView/Helpers/DateHelper.html#M001698 date_select(object_name, method, options = {}, html_options = {}) I don''t think you are going to have any success without the parens Craig -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Without knowing more about your app and your models, I would ask what the :post refers to in your date_select. If I understand you correctly, you want to render a date select field for the ''birthdate'' attribute. What model does this attribute belong to? Are you using the date_select as part of a form? If so could you post that entire form? Without further info, I''d say get rid of the '':post'' in the date_select. And go from there. -Alexis M. On Jan 28, 11:53 pm, Smit Shah <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hi all > I am using rails 2.3.5. But I am facing the problem with date_select > tag. I have written code as follow. > > = date_select :post, :birthdate, :start_year => 1950, :end_year => > Date.today.year, :prompt => { :day => ''Select day'', :month => ''Select > month'', :year => ''Select year'' } > > But I got error like "wrong number of arguments (2 for 1)". If I write > only > = date_select :post, :birthdate > than also I got the same error. > > I have tried like > date_select :post > than it gives me error like "wrong number of arguments (1 for 2)". > > Help me out..... > -- > Posted viahttp://www.ruby-forum.com/.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Alexis Mueller wrote:> Without knowing more about your app and your models, I would ask what > the :post refers to in your date_select. > > If I understand you correctly, you want to render a date select field > for the ''birthdate'' attribute. What model does this attribute belong > to? Are you using the date_select as part of a form? If so could you > post that entire form? > > Without further info, I''d say get rid of the '':post'' in the > date_select. And go from there. > > -Alexis M.Thanks for your reply.. :post is my object and the :birthdate is my field in table. With the help of :post I am able to generate field name like post[birthdate]. I cant remove that because I am using multi model in a single form. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.