I override the create action for the registration controller. I have two forms for registration, individual or company, the company has a field called company_form set to true, which distinguishes the two forms.
After checking the form, I need the correct form for rendering (previously it returned to the default form no matter what form I used).
I had a problem when only a partial image is displayed (obviously, since I only show a partial), but I need a layout / application file that will be displayed as well.
class RegistrationsController < Devise::RegistrationsController def create <!-- Other devise code here --> if resource.company_form render partial: 'shared/company_signup_form' else render partial: '/shared/individual_signup_form' end end end
I tried
if resource.company_form render partial: 'shared/company_signup_form', layout: 'layouts/application' else render partial: '/shared/individual_signup_form', layout: 'layouts/application end
But I get an error
Template is missing Missing partial layouts/_application
Why is he looking for a partial application, when I specified the layout and how can I get the correct layout to be applied, please
thanks
Edit
After reading the documentation, he says
"Please note that layouts for partitions follow the same name of the leading-underline as regular partial ones, and are placed in the same partial folder to which they belong (not in the master layouts folder).
But I want to use the default layout