Best way to create views based on a theme


Best way to create views based on a theme



I need to create separate view pages for a controller that I have.



I have a CustomerController that, based on the customer I need to create custom pages, these pages have to be stored as a file not from the db.



So normally I would have this:


class CustomerController < ApplicationController
def show
@customer = Customer.find(param["id"])
end
end



And the views would be located at:


/views/customer/show.html.erb



What I want to do is have the view pages like:


/views/customer/1/show.html.erb
/views/customer/2/show.html.erb
/views/customer/3/show.html.erb



How can I reference the specific view pages to load from within the action?
Is there a way to just pass the value 1,2,3 to the view folder path?









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

api-platform.com Unable to generate an IRI for the item of type

PHP contact form sending but not receiving emails

Do graphics cards have individual ID by which single devices can be distinguished?