Content
Permit Custom Parameters Of Plugin
Added by Sahil Sharma almost 7 years ago
Hi,
I have created a new plugin for open project, and i am adding a partial view that have some new fields. In short i am trying to add new fields in project’s setting page in open project. And i wan to save those parameters to database.
Everything is working fine but i am not able to know how i can pass my custom new parameters from my partial view. so that i can add values from those params to db.
In open project there is a class PermitParams that have methods to permit parameters. But they are only permitting default parameters. I am not getting how i can i permit my new parameters.
I dont want make any changes in open project code. I want to do it with plugin. So that when user will install the plugin he dont have to make any changes and plugin can automatically add something to permit paramters.
Thanks.
Replies (1)
If you stick to the preferred way of building the plugin around an engine based on acts_as_op_engine, you can rely on an API for adding parameters to the allowed parameter list.
If that doesn’t suffice, you can always fall back to the ruby
bestpractice of monkey patching as is done in the backlogs plugin.