ChiliProject is not maintained anymore. Please be advised that there will be no more updates.

We do not recommend that you setup new ChiliProject instances and we urge all existing users to migrate their data to a maintained system, e.g. Redmine. We will provide a migration script later. In the meantime, you can use the instructions by Christian Daehn.

Add plugin to project settings menu

Added by John Yani at 2011-03-25 09:52 pm

Hi. I need some help with adding a plugin to project settings menu.

I've added a tab to settings page, implemented a model and overrided a ProjectsController.settings method so it defines a @plugin_model global. Now I need to write a view and a controller.

So, the question is: how to write a partial view and a controller, so I can set my model's field.

I came up with the following:

<% form_for @plugin_model do |f| >
<%= flash[:notice] %>
<%= f.label :my_string %>:
<%= f.text_field :my_string %><br />
<%= f.submit %>
<
end %>

But where this form is submitted to? How to write and url for this form, so it saves my plugin_model object?
Any help?

BTW, submitted a feature request here:
https://www.chiliproject.org/issues/299


Replies (1)

RE: Add plugin to project settings menu - Added by Eric Davis at 2011-03-28 10:02 pm

John Yani wrote:

But where this form is submitted to? How to write and url for this form, so it saves my plugin_model object?

You need to create a controller and route to accept the form submission. The route will give you a url and the controller will do the actual work. At this point it's just normal Rails development so any Rails tutorial or guide should help you.

Form submission, goes to => route, sends request to => controller, does work and displays => view (or a redirect), which is sent to => browser

Eric Davis

(1-1/1)