Dear All,
<%= form_for(:crm_member_transactions, :url=>transaction_path
(:type=>type, :load=>1)) do |f|
%>
From:<%date_select
:crm_member_transactions,:from,:start_year=>1980,:end_year=>1.year.from_now.year
%>
To :<%date_select :crm_member_transactions, :to,
,:start_year=>1980,:end_year=>1.year.from_now.year%>
Email:<%= f.text_field :email_addr%>
<%= f.submit "Filter" %>
<% end%>
i want to select the date then submit it to get the value of the seleted
date,but when i get the value with params, it returns nil,these are the
values i have submitted,
{"crm_member_transactions"=>{"{:start_year=>1980,
:end_year=>2013}(1i)"=>"2008",
"{:start_year=>1980,
:end_year=>2013}(2i)"=>"3",
"{:start_year=>1980,
:end_year=>2013}(3i)"=>"1",
"to(1i)"=>"2011",
"to(2i)"=>"12",
"to(3i)"=>"1",
"email_addr"=>""},
i can get the email value by
params[:crm_member_transactions][:email_addr],but how can i get the date
value?
Thanks
--
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.
??any one can help me ?thanks -- 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.
Hi!
Take a look at:
http://guides.rubyonrails.org/form_helpers.html#using-date-and-time-form-helpers
It seems that you''ve getting some problems with the "from"
date_select,
because you''re getting:
{"{:start_year=>1980,
:end_year=>2013}(1i)
"{:start_year=>1980,
:end_year=>2013}(2i)
"{:start_year=>1980,
:end_year=>2013}(3i)
but instead, you should get from(1i), from(2i) and from(3i).
It seems too that you have a extra comma here:
date_select :crm_member_transactions, :to,
,:start_year=>1980,:end_year=>1.year.from_now.year%>
In the end of the first line and the beginning of the second there are a
comma. Maybe it''s a syntax error.
Later, you should use
params[:crm_member_transactions][:from]
and
params[:crm_member_transactions][:to]
to build the dates.
Sorry for my English mistakes. I''m not a native speaker.
Best Regards,
Everaldo
On Mon, Feb 6, 2012 at 12:50 AM, Daisy Di
<lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:
> ??any one can help me ?thanks
>
> --
> 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.
>
>
--
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.