Skip to content

Instantly share code, notes, and snippets.

@ExByt3s
Last active August 29, 2015 14:16
Show Gist options
  • Save ExByt3s/0d840a5120e7fe4d943c to your computer and use it in GitHub Desktop.
Save ExByt3s/0d840a5120e7fe4d943c to your computer and use it in GitHub Desktop.
def force_login
if !current_user
flash[:error]="Only logged in users can sell products.
Please #{view_context.link_to("Log in", :controller=>'logins', :action=>'new')}
and #{view_context.link_to("Sign up", :controller=>'users', :action=>'new')}if you don't have an account"
redirect_to auditions_url
end
end
# why thi is render in viewer
#Only logged in users can sell products. Please <a href="/logins/new">Log in</a> and <a href="/users/new">Sign up</a>if you don't have an account
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment