D
D
dexdev2014-11-12 17:58:17
Ruby on Rails
dexdev, 2014-11-12 17:58:17

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

1 answer(s)
B
Benajmin Smith, 2014-11-12
@benjaminsmith

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 question

Ask a Question

731 491 924 answers to any question