Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

override surveyor layout #49

Open
akhildave opened this issue May 4, 2015 · 2 comments
Open

override surveyor layout #49

akhildave opened this issue May 4, 2015 · 2 comments

Comments

@akhildave
Copy link

Thanks for your excellent gem. Needed quick help. I am unable to override base layout of survey controller from gem surveyor. Because surveyor_gui is overriding surveyor_controller.rb and rendering layout named "surveyor_modified". Can you please check once and update me on this. I also tried by creating same folder hierarchy as in gem but it was taking layout "surveyor_modified" from gem.Below is the code for quick reference from surveyor_gui gem .

https://github.com/kjayma/surveyor_gui/blob/master/app/controllers/surveyor_controller.rb

def self.included(base)
  base.send :layout, 'surveyor_gui/surveyor_modified'
end
@kjayma
Copy link
Owner

kjayma commented May 10, 2015

Sorry for delay in responding - been very busy. You should be able to change the layout by adding a customized surveyor_controller. Add a new layout statement at the top, and it should override the default. Per the readme:

"If you wish to customize the SurveyorController, add the following snippet to the top of your controller:

include Surveyor::SurveyorControllerMethods
include SurveyorControllerCustomMethods
These statements are necessary if calling super from within your customized methods. Be sure to insert the statements in the order shown above."

Just be aware that your layout will need to include the statements for "surveyor_add_ons" that you see in surveyor_modified. Otherwise, features like the File Upload, Stars, Grid Dropdowns and others that were bolted onto Surveyor won't work.

@akhildave
Copy link
Author

Sorry for delayed reply
I did add SurveyorController, and also checked again as you suggested..But still it renders layout from surveyor_gui.
screen shot 2015-05-18 at 3 31 50 pm

Here is a link to sample application : https://github.com/akhildave/survey-application
Here is link to my SurveyorController, where i am specifying "base.send :layout, 'surveyor_custom'" https://github.com/akhildave/survey-application/blob/master/app/controllers/surveyor_controller.rb

Thanks for your time :) pls update me on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants