Project

General

Profile

Actions

Defect #29826

open

Can't use back_url in Documents

Added by Krystian Ł. over 5 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Documents
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Affected version:

Description

Hello, I'm developing an feature for existing open source redmine plugin (ERPMine).
I already found a way to connect CRM contacts, accounts, and leads with projects, documents, issues etc.
What now I'm trying to is to allow creation of new document, issue, project etc. from ERPMine CRM.

<%= link_to l(:label_new_item, l(:field_issue)), url_for(controller: "issues", action: "new", project_id: 'project_id', "issue[custom_field_values][#{wkcustomfield.custom_field.id.to_s}]" => entry.id, :continue => true, :back_url => request.fullpath), class: 'icon icon-time-add', id: link_id, onclick: "get_project(event, '#{link_id}', '#{select_id}')".html_safe %>

(get_project is a javascript that replace "project_id" with project id)
And it works for issues. After I create new issue it redirect me to lead/account/contact as it should.
But It doesn't work for documents...

<%= link_to l(:label_new_item, l(:label_document_plural)), url_for(controller: "documents", action: "new", project_id: 'project_id', "document[custom_field_values][#{wkcustomfield.custom_field.id.to_s}]" => entry.id, :continue => true, :back_url => request.fullpath), class: 'icon icon-time-add', id: link_id, onclick: "get_project(event, '#{link_id}', '#{select_id}')".html_safe %>

I know had read documents controller, and I see the part:

redirect_to document_path(@document)

However it still inherits from ActiveRecord::Base which have back_url. Shouldn't it still work? Am I doing something wrong, or is it impossible to do it without editing DocumentsController?

No data to display

Actions

Also available in: Atom PDF