Note that there are some explanatory texts on larger screens.

plurals
  1. POredmine plugin development NameError
    primarykey
    data
    text
    <p>I am not a rails developer. I am a systems engineer trying to create a simple redmine plugin that shows the contents of a backup folder. Basically the output of Dir.glob("/path/to/folder"). I could achieve this in the irb console. </p> <p>I followed the official redmine plugin tutorial. I dont need any model because i dont want to store any database. This is just a view to show the contents form the filesystem. I created a controller which automatically generated the view. I am getting a Nameerror. Pasting the code i have made for the relevant files. Please help me with making a redmine plugin that just outputs the contents of a folder to the browser. Also how do I execute certain system calls and show the outputs in the plugin?</p> <p>plugin name: redmine_backups</p> <p>controller: backups_controller.rb I havent touched this file at all.</p> <p>app/views/backups/index.html.erb</p> <pre><code>&lt;h2&gt;Backups#index&lt;/h2&gt; &lt;table&gt; &lt;ul&gt; &lt;% @files = Dir.glob("/tmp/*") %&gt; &lt;% @files.each do |f| %&gt; &lt;%= f %&gt; &lt;% end %&gt; &lt;/ul&gt; &lt;/table&gt; </code></pre> <p>redmin_backups/init.rb</p> <pre><code>require 'redmine' Redmine::Plugin.register :redmine_backups do name 'Redmine Database Backups plugin' author 'Author' description 'This is a plugin for displaying database backups within Redmine' version '0.0.1' url 'http://example.com/path/to/plugin' author_url 'http://example.com/about' menu :application_menu, :backups, { controller =&gt; 'backups', :action =&gt; :index }, :caption =&gt; 'Backups', :last =&gt; 'true' end </code></pre> <p>The error I get is <code>undefined local variable or method 'controller' for #&lt;Redmine::Plugin:0x7f28330ca2f8&gt;</code></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload