using //= require statemements in application.js

15 views
Skip to first unread message

fugee ohu

unread,
Feb 29, 2016, 4:39:34 AM2/29/16
to Ruby on Rails: Talk
Using require statements in application.js should reference files located where?
//= require bootstrap-sprockets
where is bootstrap-sprockets supposed to be located?

nanaya

unread,
Feb 29, 2016, 5:13:13 AM2/29/16
to rubyonra...@googlegroups.com
Hi
Any of directories in `config.assets.paths`. (can be checked with
`Rails.configuration.assets.paths` from rails console).

fugee ohu

unread,
Feb 29, 2016, 6:37:51 AM2/29/16
to Ruby on Rails: Talk

That doesn't seem to be an answer to my question

Colin Law

unread,
Feb 29, 2016, 6:44:21 AM2/29/16
to Ruby on Rails: Talk
If you have included the appropriate gem in Gemfile then you don't
need to put it anywhere.

Colin

>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/e765dfe2-3dad-459e-adfc-92da95a65d80%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

fugee ohu

unread,
Feb 29, 2016, 8:03:39 AM2/29/16
to Ruby on Rails: Talk


On Monday, February 29, 2016 at 5:13:13 AM UTC-5, nanaya wrote:

I'm sorry yes it does answer my question, somewhat, thanks

fugee ohu

unread,
Feb 29, 2016, 8:25:14 AM2/29/16
to Ruby on Rails: Talk

Thanks, Colin So then why require them if they're all "gemmed out"? I'm having trouble getting data-description to work in bluimp-image-gallery If you read the docs it can be found  under Additional Gallery Elements The docs say to include links to javascript scripts at the bottom of my view using <script src= ... So that's what I did Seemed the javascript in question wasn't working so when I asked for help someone asked me if I was using the asset pipeline and then if i'm using the asset pipeline why am i putting the links to javascript scripts <script src= ... in my views and the discussion ended up concluding just about there after trying to get clarification Here's a gist of the files involved https://gist.github.com/mices/f9516cb3ea9da3f3c690 ~ thanks, fugee

Colin Law

unread,
Feb 29, 2016, 8:44:22 AM2/29/16
to Ruby on Rails: Talk
Not sure what you mean by gemmed out.
I believe that you should either require it in application.js (in
which case it will be compiled in with the other js files) or
specifically include it in the page using the script tag. The former
is generally preferred as it means the browser should only load the js
once for the whole website. I have not used this particular library
though so don't know whether there is a reason why it should be
explicitly loaded in the page.

Google found this which may be helpful
http://stackoverflow.com/questions/21519040/rails-4-bootstrap-set-up-assets

Colin

fugee ohu

unread,
Feb 29, 2016, 2:21:18 PM2/29/16
to Ruby on Rails: Talk

Bootstrap's working, image gallery's working So, this is not the problem anyway The problem is i can't get the contents of data-description to display with the full image in the lightbox, which as it happens is the job of one js file I was thrown a curve with this question that was posed to me about the asset pipeline, but i'm very glad that you clarified that for me Also, if I add controls to the gallery widget, then the title displays in the full image lightbox view, as long as I pass a value to title in my view I've tried using static content for the data-description but that didn't make any difference ~ thanks, fugee
Reply all
Reply to author
Forward
0 new messages