Reputation: 3514
I new in rails. I trying to write redmine plugin to extend sidebar with chat. Hook works with static data. How to pass data? generated by controller?
I have simple controller and list.js.erb
$('#chat-plugin-messages').empty().append("<ul> <%= j render @messages %> </ul>");
How to call it from hook?
hook
module ChatPlugin
class Hooks < Redmine::Hook::ViewListener
render_on :view_projects_show_sidebar_bottom,
:partial => 'hooks/chat/sidebar'
end
end
upd:
View has been rendered, but controller not called. So i have nil
in @messages
variable.
UPD:
Code https://github.com/alex-eri/redmine-chat
This works with now, but i want render same block with .
Upvotes: 0
Views: 670