Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duda crear modelo #160

Open
franciscares opened this issue Nov 26, 2021 · 0 comments
Open

Duda crear modelo #160

franciscares opened this issue Nov 26, 2021 · 0 comments

Comments

@franciscares
Copy link

Hola, nos sale este error cuando intentamos inscribir un usuario en un curso

ActionController::RoutingError (No route matches [POST] "/courses/show"):

Usamos una tabla intermedia para la relación entre usuarios y cursos y el form no está logrando crear la asociación. Este es el form que hicimos:

<%= form_with(model: @users_course, method: :post) do |form| %>

<p>
<%= form.text_field :user_id, :value => current_user.id, readonly: true%>
</p>

<p>
<%= form.text_field :course_id, :value => @course.id, readonly: true%>
</p>

<div>
    <%= form.submit 'enroll' %>
</div>

<% end %>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant