Conditional sign up with rails 4 -


I have a small problem with my application.

Instead of giving my visitors the option of signing, it is redirecting everyone who immediately visits my application to sign in or unable to navigate to other tabs Are there.

For further explanation in my application.html.erb file, I have the following code:

   if user_signed_in? & Gt%; & Lt; Strong> & Lt;% = current_user.email% & gt; & Lt; / Strong> Logged in as. & Lt; Br> & Lt; Br> & Lt;% = link_to 'Edit Profile', edit_user_registration_path ,: class = & gt; 'Nevar-link'% & gt; | & Lt;% = link_to "logout", destroy_user_session_path, method :: delete, class = & gt; 'Nevar-link'% & gt; & Lt;% else% & gt; & Lt;% = link_to "Sign up", new_user_registration_path,: class = & gt; 'Nevar-link'% & gt; | & Lt;% = link_to "Login", new_user_session_path ,: class = & gt; 'Nevar-link'% & gt; & Lt; / P & gt; & Lt;% end% & gt;  

If someone can give me directions that I have to take the route to sign in as an alternative, and all in my application This is not the default for visitors it would be greatly appreciated.

The code in my application_controller.rb file is as follows:

  class ApplicationController & lt; ActionController :: Base # Prevent CSRF attacks by raising an exception. For #API, you might want to use it: null_session instead with Protect_from_forgery :: exception before_action: authenticate_user!  skip_filter  announcement in the controller in which you do not want to force authentication; 

  skip_filter: authenticate_user!  

If you have a controller, where only certain actions should be uncertified (for example, index and show action):

  skip_filter: authenticate_user! Only: [: Index, Show:]  

Or you can open all tasks except some specific ones:

  skip_filter: authenticate_user !, Except: [: Create, update]  

Comments

Popular posts from this blog

winforms - C# Form - Property Change -

javascript - amcharts makechart not working -

java - Algorithm negotiation fail SSH in Jenkins -