Answer the question
In order to leave comments, you need to log in
Where are gem files installed in RoR 4?
Please tell me in which directory the gem files for Ruby on Rails 4 are installed.
The point is to be able to change the code
. For example.
For the will_paginate gem.
After adding <%= will_paginate @items %>
to the view (views)
, the following html code is generated:
<div class="pagination">
<a class="previous_page" rel="prev start" href="/items?page=1">← Previous</a>
<a rel="prev start" href="/items?page=1">1</a>
<em class="current">2</em>
<a rel="next" href="/items?page=3">3</a>
<a class="next_page" rel="next" href="/items?page=3">Next →</a>
</div>
Answer the question
In order to leave comments, you need to log in
To see where the gem is installed:
to view the sources, (for editing later)
about edits - it is not recommended to change the installed gems, for example, all your edits will be lost when you update the gem
1. expand the library with 'Monkey patch', advantage, you do not edit anything in the source library, shortcomings, fixing errors after the author of the gem has made changes;
2. make a local/remote (fork) copy, and install that version, the advantage of being in control of changes happening to the gem. It looks something like this:
cd <path>
gem unpuck <name_gem> (если без git`a)
git clone --bare <адрес> (если с git)
#... правки gem`a ...
# Вариант 1. Настройки Bundle, говорим, что <name_gem> локальный (главное не забыть об этом)
bundle config local.spree <path>/<name_gem>
# Вариант 2: Gemfile:
gem 'name_gem', path: <path> # локально
gem 'name_gem', :git => '<repo path/url>', :branch => 'you_hack_branch'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question