Answer the question
In order to leave comments, you need to log in
How to do authentication and model creation in one form?
I use the devise gem for authentication, the task is to create a Post model and if the user is not authenticated or not registered, register or authenticate him and create a Post model how to do this using devise? so that letters leave and so on? Can you please tell me which controller it will be in? maybe there are links to publications from whom the thread?
Answer the question
In order to leave comments, you need to log in
Good afternoon. I would do so.
<% if user_signed_in? %>
<% link_to 'Создать статью', new_post_path %>
<% else %>
<% link_to 'Войдите, чтобы написать статью', new_user_path %>
<% end %>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question