Guest User

Untitled

a guest
Mar 13th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. def create
  2. @admin = User.find(:all, :conditions => [ "username = ? and password = ?", params[:username], params[:password]])
  3. if @admin
  4. else
  5. redirect_to(admin_url)
  6. end
  7. end
  8.  
  9.  
  10.  
  11. ## form
  12.  
  13. <% form_for :admin do |f| %>
  14. <%= f.text_field :username %>
  15. <%= f.password_field :password %>
  16. <% end %>
Add Comment
Please, Sign In to add comment