I am overriding the create action of the devise Registrations Controller. I have two forms for signup, individual or company, a company has a field called company_form set to true that differentiates the two forms.
Upon form validation I would like the correct form to render (previously it was going back to the default form no matter what form i was using).
I am having an issue where just the partial is being rendered (obvious as i am only rendering the partial), but I need the layouts/application file to be rendered aswell.
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 have 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 it looking for a partial _application when I specified layout and how can i get the correct layout to be applied please
Thanks
Edit
Reading through the documentation it says
"Note that layouts for partials follow the same leading-underscore naming as regular partials, and are placed in the same folder with the partial that they belong to (not in the master layouts folder)."
But i want the default layout to be applied