Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Two different login pages for one model with devise on rails

I am working on an rails app in which there is one table Users, which has two roles Admin and member. Until now I am using single login page.

But now, I need to make two different login pages with completely different styling for admin and member. Moreover Admin don't have sign_up option but member has.

I am totally confused that is it possible or not? If possible, how to achieve this.

like image 346
Muhammad Faisal Iqbal Avatar asked Nov 07 '25 00:11

Muhammad Faisal Iqbal


1 Answers

Devise sign in form is just a form with action matching to devise controller.

You can write this form code anywhere you like,

<%= form_for(:user, :url => session_path(:user)) do |f| %>
  <%= f.text_field :email %>
  <%= f.password_field :password %>
  <%= f.check_box :remember_me %>
  <%= f.label :remember_me %>
  <%= f.submit 'Sign in' %>
  <%= link_to "Forgot your password?", new_password_path(:user) %>
<% end %>
like image 193
maximus ツ Avatar answered Nov 09 '25 18:11

maximus ツ



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!