Pab wrote in post #1019703:
> Hi Jim,
>
>
>
> I got nothing in my action search and linked the search button to
> search1 action, which contains the find function is that a problem?
>
Yes. Here is the order of what happens:
1) The browser sends a request that hits the action connected to your
view.
2) The action executes and the view containing your form is processed by
rails and sent to the browser.
3) All variables in your app and their values are destroyed.
4) The user fills out the form and clicks the submit button, which sends
the request to your search1 action, causing the code in search1 to
execute.
So any code in the search1 action executes long after rails processes
the view. In your view, you referenced the @employee variable, so that
view's action has to assign a value to @employee.
--
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@googlegroups.com.
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.
No comments:
Post a Comment