Comments (6)
Strong params are a bit indirect in Surveyor and SurveyorGui. You can find them in SurveyorGui under app/models/permitted_params_decorator.rb. That file reopens the PermittedParams class which is originally defined in the Surveyor gem at app/models/permitted_params.rb.
Not sure why you might be experiencing this error. Perhaps you can provide some more information:
- Are you using the testbed application as-is or have you customized it any way?
- What versions of ruby and rails are you using?
- Does the error message indicate which specific attribute is causing the problem?
from surveyor_gui.
First I'm using the 'simple_form' branch of Surveyor and 'zurb' branch of SurveyorGui. No error attributes was specified only the parameters from the survey submitted were returned(I don't have the screenshot anymore). I haven't customised the testbed application. Rails version is '4.1.6', Ruby is '2.2.0'.
I tried using the SurveyorGui on another branch of my real app but I kept getting error with the simple_form version. I'm guessing Surveyor is locked for simple_form '3.1.0.rc' while SurveyorGui is locked for simple_form '3.0.2'.
Could it be beacuse I'm not using the master branches of the gems? I 've tried it too and I got this error: "undefined method `boolean_label_class=' for SimpleForm:Module (NoMethodError)"
from surveyor_gui.
So a couple of things - the Zurb branch of SurveyorGui is a work in
progress and definitely has bugs. The simple_form branch of Surveyor also
was broken last I checked and I don't think that's changed. I prefer
Simple Form over Formtastic, but was never able to get that branch of
Surveyor to work (though I didn't put a lot of time into it). I'd avoid
the custom branches. Pull the latest surveyor_gui master from github and
go with that. Otherwise, be prepared to do some debugging on your own.
Your welcome to fork surveyor_gui and see if you can finish up the Zurb
branch and get simple_form working with Surveyor. I'd be happy to pull it
in if you get it working :)
On Thu, Feb 5, 2015 at 7:23 AM, Taiwo Ayanleye [email protected]
wrote:
First I'm using the 'simple_form' branch of Surveyor and 'zurb' branch of
SurveyorGui. No error attributes was specified only the parameters from the
survey submitted were returned(I don't have the screenshot anymore). I
haven't customised the testbed application. Rails version is '4.1.6', Ruby
is '2.2.0'.I tried using the SurveyorGui on another branch of my real app but I kept
getting error with the simple_form version. I'm guessing Surveyor is locked
for simple_form '3.1.0.rc' while SurveyorGui is locked for simple_form
'3.0.2'.Could it be beacuse I'm not using the master branches of the gems? I 've
tried it too and I got this error: "undefined method `boolean_label_class='
for SimpleForm:Module (NoMethodError)"—
Reply to this email directly or view it on GitHub
#43 (comment).
from surveyor_gui.
In Rails 4, The error is due to the params in the update
method that are not permitted.
As a workaround, I'd suggest to override the update
method of the surveyor_controller.rb
by generating a custom controller and define private params methods permitting the different params.
To do so:
$ rails generate surveyor:custom
Then in the update
method, remove the call to super
, get the method's source code and define private methods to permit the params.
My code :
# [...]
def update
#super
question_ids_for_dependencies = (r_params || []).map{|k,v| v["question_id"] }.compact.uniq
saved = load_and_update_response_set_with_retries
return redirect_with_message(surveyor_finish, :notice, t('surveyor.completed_survey')) if saved && finish_params
respond_to do |format|
format.html do
if @response_set.nil?
return redirect_with_message(surveyor.available_surveys_path, :notice, t('surveyor.unable_to_find_your_responses'))
else
flash[:notice] = t('surveyor.unable_to_update_survey') unless saved
redirect_to surveyor.edit_my_survey_path(anchor: anchor_from(section_params), section: section_id_from(params))
end
end
format.js do
if @response_set
render json: @response_set.reload.all_dependencies(question_ids_for_dependencies)
else
render text: "No response set #{response_set_code_params}",
status: 404
end
end
end
end
# [...] [And in the custom controller : ]
private
def r_params
return unless params[:r]
params.require(:r).permit!
end
def section_params
return unless params[:section]
params.require(:section).permit!
end
def finish_params
return unless params[:finish]
params.require(:finish)
end
def response_set_code_params
return unless params[:response_set_code]
params.require(:response_set_code).permit!
end
# [...]
PS : sorry for my English. And feel free to propose improvements to this workaround, because I'm not sure I've found the optimal solution yet ;)
from surveyor_gui.
Hi, I have the same error appearing when I try to preview my survey, after one section I get the Forbidden Attributes Error.
When I was using surveyor_gui 0.1.2, EmCousin's workaround worked, but now that I'm getting surveyor_gui from the master it doesn't work anymore. I am not very familiar with ruby on rails, so I have a hard time understanding what everything does.
Any idea what might be the problem?
from surveyor_gui.
Hey guys, I'll take another look, but would one of you be able to specify a test case that I can try off the master branch? What conditions are creating this error? Thanks
from surveyor_gui.
Related Issues (20)
- Slider becomes dropdown after a logic dependency is added HOT 3
- Status of mandatory question feature HOT 1
- Feature: Dependencies to support sum of integer responses HOT 1
- Surveyor gui not available at /surveyforms like readme says HOT 1
- Documentation needed for layout files regarding #surveyor_gui_mount_point
- Support for HTML in answers HOT 1
- Asset precompile fails with undefined method `column_attributes' HOT 6
- Questions that are mandatory and dependent on another question do not display HOT 2
- Report generation doesn't scale HOT 14
- Override suveyor partial inside surveyor_gui HOT 8
- Unable to perform rails g surveyor_gui:install HOT 6
- override surveyor layout HOT 2
- missing migration for QuestionType model? HOT 1
- SurveyorController Pundit authorization HOT 1
- Unable to execute the command "rails g surveyor_gui:install" HOT 1
- Help Required HOT 2
- Install process causing "PermittedParameters" error HOT 1
- Custom templates HOT 3
- Rails 6 surveyor_gui not working HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from surveyor_gui.