ruby on rails - Adding class to link_to causes error -


i have sign facebook text link in app. tried add class text link turn button.

in rails it's written display text.

= link_to_session 

so, rule added following

= link_to_session 'sign up', class: 'button button-primary' 

but gave me error...

wrong number of arguments (2 0) 

how fix this...? thank time!

update sorry.. i'm not quite sure at...

i looked @ session controller , in controller following written...

class sessionscontroller < applicationcontroller    def create     auth = request.env["omniauth.auth"]     user = user.find_by_auth(auth)     if user.blank?       if session[:user_id].present?         # via token         user = user.find(session[:user_id])         user.definitive_by(auth)       else         # new user         user = user.find_or_create_by_auth(auth)       end     else       user.token = auth.credentials.token       user.save!     end     session[:user_id] = user.id     redirect_to root_url   end    def create_via_token     session[:user_id] = params[:user_id]     redirect_to '/auth/facebook'   end    def destroy     session[:user_id] = nil     redirect_to root_url   end  end 

try following

= link_to 'sign up', "write path here", class: 'button button-primary' 

here session path should present in route.


Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -