0

I am created a Redmine plug in for message system. Along with messages user can able to attach files. For that purpose I am trying to use existing AttachmentsHelper.

Here is my sample code

in index.html.erb

<% if not @members.blank? %>

<% form_for :note, @note, :url => {:action => 'create', :project_id => @project.id}, :html => {:multipart => true, :id => 'note-form'} do |f| %>

  <%= f.hidden_field :p_id, :value => @project.id %>
  <p><%= f.text_area :content, :cols => 40, :rows => 6, :class => 'wiki-edit', :id => 'message_content' %></p>
  <p> <%= render :partial => 'attachments/form' %></p>
  <%= submit_tag l(:button_create) %>

<% end %>

<% end  %>

in my controller.rb

class CommunicationsController < ApplicationController
unloadable
include AttachmentsHelper

def create
 #code for saving message
end

end

The above code not working and also I din't get any error. What i am missing?

Can any one help me to solve this issue?

Karthi Ponnusamy
  • 2,031
  • 2
  • 25
  • 41

2 Answers2

2

You should use

helper :attachments_helper
Kirill Bezrukov
  • 592
  • 4
  • 6
1

To use existing helpers in your redmine plugin. Try adding

require File.dirname(__FILE__) + '/../../../../../app/helpers/attachments_helper'

at the top of your controller

hitesh israni
  • 1,742
  • 4
  • 25
  • 48