Hi,
there is somthing, that I do not understand.
class MyController < ApplicationController
def index
...
end
def my_def
redirect_to :action=> "index" unless params[:id]
my_model = MyModel.find(params[:id])
...
end
end
when I try to call "my_controller/my_def" without an id in y browser,
then the find-statement will is evaluated :-( why?!?
thanks Guido
--
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---