I am new to rails and I am building a blog like application called story teller.I have used devise to have a sign up, sign in model.I also tweaked and used the devise features allowing me to add a user-name during sign up and then sign in with either username or email.Next I added a devise admin model.However when I go to admin signup or signin page, it throws the following errors http://localhost:3000/admins/sign_in : NoMethodError in Devise::Sessions#new
http://localhost:3000/admins/sign_up : NoMethodError in Devise::Registrations#new
My devise session new form i.e new.html.erb in devise/session view is here
<h2>Log in</h2>
<%= form_for(resource, as: resource_name,
url: session_path(resource_name)) do |f| %>
<div class="field">
<%= f.label :login %><br />
<%= f.text_field :login, autofocus: true %>
</div>
<div class="field">
<%= f.label :password %><br />
<%= f.password_field :password, autocomplete: "off" %>
</div>
<% if devise_mapping.rememberable? -%>
<div class="field">
<%= f.check_box :remember_me %>
<%= f.label :remember_me %>
</div>
<% end -%>
<div class="actions">
<%= f.submit "Log in" %>
</div>
<% end %>
<%= render "devise/shared/links" %>
My devise registration new form i.e new.html.erb in devise/registration is here
<h2>Sign up</h2>
<%= form_for(resource, as: resource_name,
url: registration_path(resource_name)) do |f| %>
<%= devise_error_messages! %>
<div class="field">
<%= f.label :username %><br />
<%= f.text_field :username, autofocus: true %>
</div>
<div class="field">
<%= f.label :email %><br />
<%= f.email_field :email, autofocus: true %>
</div>
<div class="field">
<%= f.label :password %>
<% if @minimum_password_length %>
<em>(<%= @minimum_password_length %> characters minimum)</em>
<% end %><br />
<%= f.password_field :password, autocomplete: "off" %>
</div>
<div class="field">
<%= f.label :password_confirmation %><br />
<%= f.password_field :password_confirmation, autocomplete: "off" %>
</div>
<div class="actions">
<%= f.submit "Sign up" %>
</div>
<% end %>
<%= render "devise/shared/links" %>
This is my admin.rb ie admin model
class Admin < ActiveRecord::Base
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
end
I am very confused here and not able to find a work around.Please forgive me if the questions seems stupid and bear with me.Also let me know if I need to add some more information.