I’m trying to get a link on an articles show page so that when a user clicks write new review it takes them to the link
/comic_reviews/'the article they want to comment on'/reviews/new
where they will be directed to the new reviews page
how can i accomplish this with
In your routes file you would specify a route like this
match '/comic_reviews/:comic_name/reviews/new' => 'reviews#new', via: :getThen in your reviews controller you would need something like this
reviews_controller.rb
You will then have access to
@comicand@reviewin yourreviews/newview so you could build a form that just makes a post to create a review and allows you to store it. This should get you going.Edit
In your
newview you’d need to have a form that looks something like thisThis will be expecting you have a route to create a review in your routes file and an action in your ReviewsController.
If you are struggling with such topics I suggest you read over this excellent tutorial
http://ruby.railstutorial.org/ruby-on-rails-tutorial-book
Or just read through the documentation for Rails API which will give you pretty accurate examples.