Guest User

Untitled

a guest
May 25th, 2018
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. I have a partial this is setup like this for a method in controller "X"
  2.  
  3. _login.rhtml:
  4. <% form_tag do %>
  5. <p>Please log in.</p>
  6. <p>
  7. <label>Username:</label>
  8. <%= text_field_tag 'login' %>
  9. </p>
  10. <p>
  11. <label>Password:</label>
  12. <%= password_field_tag 'password' %>
  13. </p>
  14. <p><%= submit_tag 'login' , :controller => 'account', :action => 'login' %></p>
  15. <p><%= submit_tag 'Lost Password', :controller => 'account', :action => 'lost_password' %></p>
  16. <% end %>
  17.  
  18. And is being rendered by a method in controller "Y" withing a different view like so:
  19. <%= render :partial => 'account/login' %>
  20.  
  21. On pressing submit, on the partial, the request that goes out is:
  22. Parameters: {"commit"=>"login", "authenticity_token"=>"09f0ebf284cf1480471b93ef1d94f0f0e88d667b", "action"=>"index", "controller"=>"home", "password"=>"kuta", "login"=>"hkhan"}
  23.  
  24. The question is why does the controller name not change from home to account?????
Add Comment
Please, Sign In to add comment