Project

General

Profile

Ruby Noob - Need Assistance With Simple Plugin Dev

Added by Anonymous almost 11 years ago

As the title suggests, I know very little about Ruby.. I'm attempting to override Redmine's default app views with custom markup, specifically in order to restructure the UI with Bootstrap 3 markup and styling. Apologies if this has already been covered, I did search the forum, but couldn't find any answers.

So far, I've read through this tutorial, generated a plugin, run the DB migration, restarted the Redmine app and I've got it overriding views without any errors. For what it's worth, I'm working on a Windows Bitnami Redmine stack running 2.4.2.

My issue is that I have to restart my app after every single change, whether creating a new view file or modifying an existing one. I'm considering writing a temporary Grunt script to restart the service if one of the plugin files change, but before I do that I'd like to know:

  • Is this really necessary...?
  • Is this behaviour a Redmine thing or a Ruby/Rails thing?
  • Is there a more efficient way to do this? Keep in mind all I'm after here is overriding the views, I'm not extending any controllers or models at the moment.
  • Would running my app with a different "RAILS_ENV" make any difference here, or does that simply specify which configuration to use?

To explain; my project requires a mobile-first layout (I'm targeting phones, tablets and desktop), but the current UI markup isn't quite up to the challenge. Working like this is going to drive me insane, forcing me to either make massive changes blind or restarting the app a thousand times..

Quick edit: On a similar note, is there any documentation available that covers the view files in Redmine? Specifically which views are used in which areas of the app, the order they're loaded in, etc.. Or would I need to resort to reading the controllers to see which views are requested for different URLs?


Replies (1)

RE: Ruby Noob - Need Assistance With Simple Plugin Dev - Added by Anonymous over 10 years ago

To expand my initial question, I've been reading through various Ruby tutorials and guides lately, focusing mainly on asset management and environment configuration. While diving into the middle of a project like Redmine still leaves me feeling very overwhelmed, I can now at least follow most of the logic while reading the code... All this newfound knowledge has brought other questions with it though.

Since jQuery UI and Bootstrap don't like to share their toys, I have two options here.. Ignoring the obvious template updates for now:

First option is to completely remove jQuery UI and rework the view files using Bootstrap classes, but this looks like it's going to be a mountain of work for one person. This has the benefit of being a much cleaner finished product, relying on only one UI library.

Second option is to use something like jquery-ui-bootstrap and put these two little kiddies in opposite corners of the playground, but this has the potential to turn into a giant mess of dependencies down the line, depending on how each individual project changes in the future... Lets face it, nobody like having to worry about their project dependencies as well as each of their dependencies.

In light of this, I'm assuming I can simply remove the current jquery-rails gem, the tags = javascript_include_tag('jquery-1.8.3-ui-1.9.2-ujs-2.0.3', 'application') reference in application_helper.rb and the <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', :media => 'all' %> in base.html.erb, then install the bootstrap-sass gem and create new asset references.. Or is there more to it than this?

Proof reading all of this makes me think I should just swap one out for the other and deal with the consequences, but I'd still love to get some sort of feedback from someone who's worked with Ruby/Rails before.

    (1-1/1)