Select_month post and params

Hi

why is that not working?

Controller-----------------------------------------------------

def bla

  month = params[:month_select]

  redirect_to :action => "index"
  flash[:error_messages_for] = month.to_s

end

View----------------------------------------------------------

<%form_tag :action => “bla” do %>

<%= select_month(Date.today, :field_name => ‘month_select’) %>
<%= submit_tag “Jump” %>

<% end %>


The notice is empty after the post.

Greetings, Andi

The redirect should be the last statement.

On 11/22/08, Andi G. [email protected] wrote:

  month = params[:month_select]

<%form_tag :action => “bla” do %>
Greetings, Andi

Posted via http://www.ruby-forum.com/.


James M.

hi

thanks for the answer!

this is not the problem. The notice will be shown up on the index.

The problem is that the post is empty. If i exchange the select_month
with select_date the post work out.

for example:

I choose the date: 22.11.2008 the result is: month11day22year2008 (i am
not sure about the order)

Other ideas?

On Nov 22, 3:30 pm, Andi G. [email protected]
wrote:

hi

thanks for the answer!

this is not the problem. The notice will be shown up on the index.

The problem is that the post is empty. If i exchange the select_month
with select_date the post work out.

Check your logs to see under what name the parameter arrives (or look
at the rendered html)

Fred

Check your logs to see under what name the parameter arrives (or look
at the rendered html)

Where are those logfiles? in the rendered html it is correct i think:
name=“date[month_select]”

Andi G. wrote:

Check your logs to see under what name the parameter arrives (or look
at the rendered html)

Where are those logfiles? in the rendered html it is correct i think:
name=“date[month_select]”

Ah okay i know what logfile you mean :slight_smile:

this is from this log:

“date”=>{“month_select”=>“11”, “year_select”=>“2008”}

how can i params the month_select?

sorry for the soliloquy.

this is the solution:

<%= select_month(Date.today, :prefix => ‘month_select’, :field_name =>
‘’) %>

prefix is the right option -> params[:month_select]
the field_name option is an extension befor the name ->
if you select the november as month the value is field_name + month,
default is “month”.

thanks and cya :wink:

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs