V
V
Voldemar Duletsky2013-03-14 13:22:09
Ruby on Rails
Voldemar Duletsky, 2013-03-14 13:22:09

Building a project on rails

I am doing my first project on rails and want to ask a question about the project structure.

The project is on github, let's say I use several jquery plugins (located in /app/assets/javascript), adding them to my repository seems to me not a very good tone.

Is there such a collector in rails that, when building a project in production, downloads all the necessary plugins for JS from where?

PS I am using rails 3.2

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
int03e, 2013-03-14
@int03e

Well, do not keep them in the project, just link to the CDN.

F
FanKiLL, 2013-03-14
@FanKiLL

app/assets- for files that belong to or are created by the application itself.
lib/assets- for your libraries, which you yourself wrote and belong to you.
vendor/assets- for libraries from third-party developers.
This does not solve your problem, but at least you will not interfere with your files with other people's libraries. I also started throwing everything in app/assets, there’s nothing wrong with that, it’s just not beautiful and my hands don’t reach to rearrange everything in its place - laziness ...
There are gems for popular frameworks that can be included in the gemfile

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'bootstrap-sass'
  gem 'chosen-rails'
  gem 'angularjs-rails'
  gem 'markitup-rails'
  gem 'font-awesome-rails'
end

Look for the gem you need.
For example jquery plugins.
  gem 'chosen-rails'
  gem 'markitup-rails'

As an option, I have not tried it myself, you can add a folder to asset-pipeline
config/application
config.assets.paths << "/home/username/Dropbox/jsLibs"

And put libraries in dropbox.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question