Displaying 20 results from an estimated 30000 matches similar to: "Keeping it DRY. Same constant needed in js, sass, and rails"
2012 Jan 01
3
'require_tree .' does not seem to be including the available *.js files as expected. Why?
Hi, all,
Happy new year :)
Referring to http://guides.rubyonrails.org/asset_pipeline.html, it
seems that ''require_tree .'' in myapp/app/assets/javascripts/
application.js will include all *.js files in the myapp/app/assets/
javascripts/.
I have a few other *.js files in this directory : parts.js, makes.js
and categories.js.
Here''s an extract from the html file I
2013 Jan 23
2
Problem with Bootstrap-SASS
I''ve installed bootstrap-sass, and added an @import line in my css. Rails
won''t find or serve up the bootstrap files. One error msg on the Mozilla
console says:
The stylesheet http://localhost:3000/assets/bootstrap was not loaded
because its MIME type, "application/javascript", is not "text/css".
Hmm. If I change the @import to say
2011 Nov 21
1
uninitialized constant Sass::Script::Functions::EvaluationContext
Hi, after deploying a bunch of modifications to my web app... I get the
error attached trying to load the page (see attached file). This is my
environment.rb file:
config.gem ''warden''
config.gem ''devise'', "~> 1.0.9"
config.gem "role_model"
config.gem "formtastic", :version => "~> 0.9.10"
config.gem
2011 May 06
2
Rails 3.1(beta1) + SASS + variables
Hello all,
in Rails 3.1, is it possible to define global SASS variables (and mixins)
that are shared across all *.css.scss files?
I am able to define SASS variables, yet they seemed to be scoped only within
each individual file …
On a side note -- is there a way to pass variables from my Rails app to the
SASS + JS (or CoffeeScript) files?
Thanks for your help.
Best,
Tomas
--
You received
2011 Jun 16
0
Rails 3.1, SASS, @import, and directories
So, here''s the problem: @import isn''t liking other directories.
Example:
app/
assets/
stylesheets/
extras/
_mixins.sass
_variables.sass
photographs/
index.css.sass
And the contents of app/assets/stylesheets/photographs/index.css.sass is:
@import "../extras/mixins", "../extras/variables"
I get the following
2012 Jan 15
2
DEPRECATION WARNING: Passing a template handler in the template name is deprecated. (rspec + haml)
I upgraded a small project that I had created on 3.1.3 to 3.2.0.rc2.
Running rspec on it brings about a large amount of these messages:
DEPRECATION WARNING: Passing a template handler in the template name is
deprecated. You can simply remove the handler name or pass render :handlers
=> [:haml] instead. (called from block (2 levels) in <top (required)> at
2014 Apr 26
0
jquery_ujs.js 404
I am getting this annoying error which relates to jquery_ujs.js not
being served. Any clues?
This is the site link:
http://test.kopy.com.br/home/index
GET http://test.kopy.com.br/assets/jquery_ujs.js?body=1 404 (Not Found)
index:11
GET http://ads.panoramtech.net/loader.js?client=tac
net::ERR_BLOCKED_BY_CLIENT rev.js:4
Error in event handler for (unknown): Cannot read property 'state' of
2012 Sep 11
0
JQuery.js problem
Hello,
In my view, I am showing password strength. I had added jquery.js in
assets/javascripts. It worked. Then in the UI :- :confirm stopped working
in button_to. I was wondering why. But today I came to know that in rails
3.0 & above jquery.js is not required. So I deleted it. But something wrong
happened. now my password strength seems not to be working. & not
redirecting.
Any
2014 Apr 14
0
Foundation & Authlogic
Seems I can get either Foundation or Authlogic to work but not both -
After bundle install when I do a rails g foundation:install I get the
following:
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activerecord-4.1.0/lib/acti
ve_record/dynamic_matchers.rb:26:in `method_missing': undefined local
variable o
r method `inheritable_attributes' for ActiveRecord::Base:Class
(NameError)
2014 Apr 29
0
Bootstrap 3.1.1 is showing as BS 2...
I should first mention that I'm new to rails, but I updated to Ubuntu 14
today and I cloned my latest project from Github after installation.
Everything seems to be working just as my last push, however my project is
styled with Bootstrap 2... *but it should be 3.1.1.*
I am not using the direct files in the stylesheets folder, instead I
created my own custom.css.scss and did @import
2008 Sep 25
2
jquery, format.js and IE
I''m trying to use jQuery to write all my js unobtrusively, and running
into a bit of a problem when triggering the format.js block in IE6 (and
possibly IE7). It returns the JSON string no problem, but instead of
parsing it, IE6 asks to download the resource as a .js file.
So if my url is ''/pictures/1.js'', IE6 will ask to save or run ''1.js''
I did do
2012 Aug 29
7
custom js in rails project
Hello, I have a rails project with one controller and one action, as
simple as posible. And I''m trying to put some custom css and js to my
own index.html.erb (not public/index.html.erb), I inluded this on the
layout file:
layout file:
<!DOCTYPE html>
<html>
<head>
<title>Volei</title>
<%= stylesheet_link_tag "application", :media =>
2008 May 26
5
Noob SASS error (permission denied)
I just created the sass directory in my stylesheets directory and
when
I reload my page I get this error:
Status: 500 Internal Server Error
Permission denied - /Users/Justin/kicksite/trunk/public/
stylesheets/
application.css
/usr/local/lib/ruby/gems/1.8/gems/haml-2.0.0/lib/sass/plugin.rb:
72:in `initialize''
/usr/local/lib/ruby/gems/1.8/gems/haml-2.0.0/lib/sass/plugin.rb:
72:in
2012 Jun 14
1
Cucumber/RSpec ::: Capybara? Webrat What am I using??
Hey everybody
I''m currently reading through the Pragmatic Programmers RSpec book, and
I really enjoy it.
But I’m facing some problems because of the fact that the book is
already some years old, I guess. I have installed rvm and use Ruby
1.9.3, and I didn’t really get some Rails code examples to work
properly, so I tried it with a 1.8.7 installation, but there I had some
other problems
2009 Apr 24
2
passing a value to a js function via button_to_function
I''ve got a table of what I call resources, want to show in a jQuery
dialog a particular record when user clicks button in a row.
in the table I''m doing:
<td><%=button_to_function ''Show'',''showresource1()'',:class =>"ui-button
ui-state-default ui-corner-all", :id => resource.id %></td>
js:
<script
2013 Jan 03
1
Trying to add bootstrap to existing project, getting CSS compile error: missing file
Trying to add bootstrap to an app being ported to Rails 3.2.3.
I get the following error:
Error compiling asset application.css:
Sass::SyntaxError: File to import not found or unreadable: bootstrap.
Here''s my gem file:
source ''http://rubygems.org''
gem ''rails'', ''3.2.9''
group :assets do
gem ''sass-rails'',
2012 Jan 01
2
Calling a function inside of (function($) {})(jQuery);
I have a .js file with the following function
function set_priceKind_global(priceKind)
{
switch(priceKind)
{
case "paid":
case "free":
break;
default:
var throw_msg = "Internal confusion in set_priceKind_global"
alert(throw_msg)
throw throw_msg
}
It is triggered by
%input{''type'' => ''button'',
2009 Aug 27
0
HAML/SASS Auto Updater for $2
The recession has hit my family hard, so I''ve decided to sell an
application that I use quite often when designing websites.
Screenshot: http://img195.imageshack.us/img195/5440/screenshotisl.png
With this application, you may add haml/sass files and when they are
changed, they automatically transform into html/css. This is great for
making templates or creating webpages outside of
2009 Sep 27
4
Haml & Sass
I would like to use Haml for pages (and possibly templates) and Sass
for CSS. But I am a webgen newbie and can''t figure out the
configuration. Is such a configuration possible? Could someone help me
set it up?
2012 Dec 28
3
git push heroku master error
allo vous tous vois l''erreur
Counting objects: 66, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (52/52), done.
Writing objects: 100% (66/66), 26.30 KiB, done.
Total 66 (delta 3), reused 0 (delta 0)
-----> Ruby/Rails app detected
-----> Installing dependencies using Bundler version 1.3.0.pre.2
Running: bundle install --without development:test