Project

General

Profile

Accessing Redmine controllers via plugin

Added by Kevin Tomba over 10 years ago

Hi,

I'm learning some Ruby On Rails for a projet in my technical university and I'm trying to improve an already existing plugin (https://github.com/alrick/Reddrop) by adding some features to it, and I was wondering the following:

Is it possible to use controllers and method defined in the main redmine/app/controllers folder for the plugin?

My main goal for this project is to allow the user to synchronise his Dropbox folder with the Redmine documents (and files in it). Redmine already has a system that allow user to add file to documents and my idea would be to use the methods already written in the Redmine source code. By doing this, the activity flow would be updated as well (and that's one of my objective too).

Here is my form_tag:

<%= form_tag({:controller => "documents", :action => "add_attachment", :id => @document}, :multipart => true) do %>
..
..

And as I predicted it, I get this error:

ActionController::RoutingError (No route matches {:controller=>"documents", :action=>"add_attachment", :id=>nil}):

So that's why I'm asking you if it's possible.

Thank you