JavaScript file not showing in Rails assets file - ruby-on-rails

Can anyone tell me why JavaScript file not showing on rails application? Sorry I'm beginner to rails.
Looking for solution why Assets not showing JavaScript file.

By default there isn't "javascript" folder in "assets".

Related

Why are all the javascript files in my rails app being put into single js file

So we have an app made with rails that we are we are deploying to Heroku. We have been having very odd CSS, JS issues on the heroku build of our app. We noticed that currently all JS files are in one single 22000 line file after compiling our files. Did we 'mis-compile'? Messed up file structure possibly? Thanks, let me know if I can clarify anything.
Why do you say it is an odd issue? According to the docs:
Sprockets concatenates all JavaScript files into one master .js file and all CSS files into one master .css file.
What you call an 'issue' seems to be a 'feature'.

Sencha Architect generated layout can't integrate to Ruby on Rails Project

I'm actually working in a Ruby on Rails Project and I've created a simple layout with Sencha Architect and the files Sencha Architect generates are:
and Inside of app folder :
So I have in my Ruby on Rails project this code for the layout, in te lines 15 and 16 I have already referred to the files that were generated by sencha architect
And when I run the project the browser console displays this error:
it can't find the app/view/MainView.js wich indeed is in that rout. Can someone help me?
Javascript needs to go in app/assets/javascripts. Just placing the file in app/view doesn't make it available at that "route", this is not how Rails works. You're working with an application, not a static web site serving up all the files in the various directories.
Look into Rails Routing, and the Asset Pipeline for more information.
If you put MainView.js into app/assets/javascripts, you can include it in the application.js file, like the other files that are likely there, or if not, like this:
//= require ./MainView # brings in this one file
or
//= require_directory . # brings in all javascripts in the directory
And now when you bring in the application javascript, your MainView content will also be included.

Rails Twitter-Boostrap : Load many assets files (javascript and css)

I just started to use twitter-boostrap gem for my simple app.
When I check it loads some many javascript file which I believed it does not use in a particular page. just like show in the following image
http://i.imgur.com/Aluth.png
So the question, is it possible to manage which js file should be loaded in a page?
Thanks.

Integrating Bootswatch Theme with Twitter-Bootstrap-Rails Gem

I've got a Ruby on Rails app running with Bootstrap, which I installed using the gem twitter-bootstrap-rails.
I'd now like to integrate a new Bootswatch theme, but I'm having trouble figuring out what to do.
There are four possible downloads for each theme - a bootstrap.css file, a bootstrap.min.css file, a variables.less file, and a bootswatch.less. My question is: do I need to download and add them ALL to my ~/app/assets/stylesheets folder? or do I just need a subset of those? Currently inside ~/app/assets/stylesheets are just two files: application.css and boostrap_and_overrides.css.less. LESS really throws me off here so I'm totally confused with how it works and what I need to do to add new css files with this setup. Any help is appreciated.
You only need to download the bootstrap.css file, and rename it. The bootstrap.min.css is the same as the css file just a minified version of it. Less is just another way of writing css and accessing each property differently. Check out less. Add css file and begin integrating into html, also point html to new stylesheet.
Here's a twitter bootstrap gem for easy Bootswatch theme integration/customization for rails:
https://github.com/scottvrosenthal/twitter-bootswatch-rails

How to edit twitter bootstrap files in rails?

I'm trying to find the twitter-bootstrap files in my rails app ('bootstrap-sass', '2.0.0'), as I need to make a change directly to the bootstrap-responsive.css file, however, I can't find it.
I have bootstrap up and running, but can't seem to find the bootstrap files. How do I locate the bootstrap-responsive.css file?
Thank you!
The bootstap-sass gem uses the Rails 3.2 asset pipeline to inject the necessary stylesheets into your app. The actual stylesheet files are located in the gem installation directory, not in your project itself.
Depending on what you want to change, you can either:
Copy the _bootstrap-responsive.scss file from the gem into your app/assets directory and edit it there.
Customize the necessary Bootstrap variables before loading up Bootstrap in your application.scss file:
$btnPrimaryBackground: #f00;
#import "bootstrap";
Edit: Try looking under
app/assets/stylesheets
Here's an example
https://github.com/joliss/solitr/tree/master/app/assets/stylesheets
I'm not too familiar with the structure of rails apps but did you create a local copy or are you using the bootstrap files being hosted directly by github? You should be able to figure that out by checking one of your launched html pages and viewing the source, looking for something like
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/1.3.0/bootstrap.min.css">
If it's a local page, there should be a directory somewhere in your rails app where the files are stored - perhaps there's a 'static' folder or something similar? Try file-searching for it, good chance you might find it.
(I use Django/Python for web projects but I'll look into Rails a bit and see if I find anything)

Resources