On 7 June 2010 17:52, Mlle
<emstolfo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> I''m having trouble getting redirect_to to work.
> I have a search controller with the following code:
>
> if params[:format].include?("map")
> source = params[:format].split(''_'').second
> redirect_to :controller => "geodatas", :action =>
"map", :source
> => "samples_"+source
> else
> #if params[:jointables].include?("images")
> if params[:viewtable] == "images"
> redirect_to :controller => "images", :action =>
"list"
> else
> redirect_to :controller => "samples", :action =>
> "resultslist", :id=>nil
> end
> end
>
> In the last else it is supposed to redirect to the resultslist action
> of the samples controller, but it is going to the show action
> instead. This is the error that shows in the browser.
>
> ActiveRecord::RecordNotFound in SamplesController#show
>
> Couldn''t find Sample with ID=resultslist
>
>
> Why is it going to the show action??
>
Have a look in the log (log/development.log) and see if that helps
Colin
--
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.