I'm new to rails
On my index page, I have a list of companies with a view (button) if the user wants to view the things that he needs to enter the system, and then go to the actual viewing page that he is viewing.
So, when I try to do, I get the following error:
Started GET "/company_ratings/user_rating?company_id=3" for 127.0.0.1 at 2014-01-21 23:10:07 +0100 Processing by CompanyRatingsController#user_rating as */* Parameters: {"company_id"=>"3"} Completed 401 Unauthorized in 1ms
I canβt understand what my problem is. So can someone help me in solving this error? This is a sign of the form views / devise / sessions / new.html.erb
<h2>Sign in</h2> <%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %> <div><%= f.label :email %><br /> <%= f.email_field :email, :autofocus => true %></div> <div><%= f.label :password %><br /> <%= f.password_field :password %></div> <% if devise_mapping.rememberable? -%> <div><%= f.check_box :remember_me %> <%= f.label :remember_me %></div> <% end -%> <% if params[:company_id] -%> <div><%= hidden_field_tag :company_id ,params[:company_id]%> </div> <% end -%> <div><%= f.submit "Sign in" %></div> <% end %> <%= render "devise/shared/links" %>
This is my registration of the form views / devise / registration / new.html.erb
<h2>Sign up</h2> <%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %> <%= devise_error_messages! %> <div><%= f.label :email %><br /> <%= f.email_field :email, :autofocus => true %></div> <div><%= f.label :password %><br /> <%= f.password_field :password %></div> <div><%= f.label :password_confirmation %><br /> <%= f.password_field :password_confirmation %></div> <div><%= f.submit "Sign up" %></div> <% end %> <%= render "devise/shared/links" %>
This is my _links.erb views / devise / shared / _links.erb
<%- if controller_name != 'sessions' %> <%= link_to "Sign in", new_session_path(resource_name) %><br /> <% end -%> <%- if devise_mapping.registerable? && controller_name != 'registrations' %> <%= link_to "Sign up", new_registration_path(resource_name) %><br /> <% end -%> <%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %> <%= link_to "Forgot your password?", new_password_path(resource_name) %><br /> <% end -%> <%- if devise_mapping.confirmable? && controller_name != 'confirmations' %> <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br /> <% end -%> <%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %> <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br /> <% end -%> <%- if devise_mapping.omniauthable? %> <%- resource_class.omniauth_providers.each do |provider| %> <%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %><br /> <% end -%> <% end -%>