Kevin
Kevin

Reputation: 1614

Rails - controller to separate view

In rails, I can say

match 'user/:id/article/:id' => 'article#show'

Here the article#show, would use the Article controller, in the show action. And it would present the show view in the article folder. But what if I wanted to be specific and say show action in article controller, and present the xxx view in the xxx folder.

Upvotes: 1

Views: 122

Answers (1)

Nerian
Nerian

Reputation: 16177

You specify what page is rendered in the controller. Example:

 render 'products/show'

That will render app/views/products/show.html.erb.

Upvotes: 1

Related Questions