kjayma / surveyor_gui

An extension to nubic/surveyor that adds reports and a forms to build surveys
MIT License
45 stars 42 forks source link

Documentation needed for layout files regarding #surveyor_gui_mount_point #38

Closed archonic closed 9 years ago

archonic commented 9 years ago

As per the customization documentation, I created my own surveyor_controller.rb to specify use of the application layout. This broke the surveyor_gui js file on line 15.

surveyor_gui_mount_point = $("#surveyor_gui_mount_point").data("surveyor_gui_mount_point");
if (surveyor_gui_mount_point.length==0){
  surveyor_gui_mount_point="/";
} else {
  surveyor_gui_mount_point= surveyor_gui_mount_point.replace(/surveyforms/i, ""); 
}

It should be mentioned under Views in the readme, that when building your own layout, there needs to be an anchor point (#surveyor_gui_mount_point) for the js file.

Updated: Also the data-attribute having underscores is non-standard. The default for HAML 4.0+ is dashes. To get the underscores, I had to put Haml::Template.options[:hyphenate_data_attrs] = false into a config initializer.