0

I want to alter the views of a mounted engine called Monologue

I've found this in the docs:

Monologue.layout               = "layouts/monologue/application" # set the layout you want to use if you want to use your main_app layout

Which adds the main template, I'd rather change the engine views directly.

Where are those files located? I couldn't find them at the root of my app.

AME
  • 2,262
  • 6
  • 19
  • 39

2 Answers2

1

Gem files are located in .rvm or .rbenv folders which ever you are using.

rbenv: $HOME_DIR/.rbenv/versions/#version_no/lib/ruby/gems

rvm: $HOME_DIR/.rvm/gems/ruby-version

Faizan
  • 381
  • 1
  • 8
  • This answer is incorrect. Editing in this way will not survive updates. I have posted the correct answer below. – CryptoPiggy Jun 29 '15 at 06:01
1

The previous answer is incorrect. Don't edit the gem files directly or your edits won't survive updates.

The correct way to modify the Monologue engine's files is to copy the gem's view files into the host application's /views.

For example, create application.html.erb inside host_app\app\views\layouts\monologue and edit that file. Your rails app will hit the custom view file and instead of the default ones in the gem. You can customize any Monologue view or partial in the same way, by simply duplicating Monologue's path in your application's views.

See all the files you can modify in this section of the Monologue github repo.

Edit: More information on customizing Monologue can be found here.

CryptoPiggy
  • 700
  • 2
  • 8
  • 21