0
votes
2answers
103 views

Hiding my rails div using JS

My products view: <a href="#" id="show_metrics">Show Metrics</a> <div id="metrics" class="hidden"> <%="Number of Primary Products: ...
0
votes
2answers
118 views

Coffeescript cannot find div - railscast 114 revised

Trying to follow the guide of railscast 114 with the endless page using will_paginate but I get an error from my coffeescript: home.js.coffee jQuery -> if $('.pagination').length ...
1
vote
2answers
90 views

Rails 3.1 - Coffescript doesn't compile to js

I am migrating app from Rails 3.0 to Rails 3.1. I changed all nessasary config files and installed gems (with help of Ryan's screencast). I have few layouts and i want to load different scripts for ...
0
votes
1answer
166 views

Javascript Coffeescript won't work

I can't seem to have coffee script works. I am trying a simple auto complete with jquery. Here the code i have that i am trying to implement an autocompletion on <%= form_tag "/search", :method ...
1
vote
1answer
189 views

Backbone and Rails redirect

I'm new with backbone and Rails. When I return to the index view in the last line, the index view is not updated with the new value created. class App.Views.ProfilesIndex extends Backbone.View ...
0
votes
1answer
96 views

passing data to modal

After checking Google for a long time, I can't find a solution: A link like this: <%= link_to instruction.name, "#myModal", :data => {:toggle => "modal",\ :id => instruction.id}, ...
1
vote
1answer
190 views

Rails 3.x asset pipeline including coffeescript file in view

I have recently came across where I would like to simply just include a coffeescript file in a single Rails view, but when you use the javascript_include_tag it appends .js to the end of the name you ...
0
votes
1answer
524 views

Rails 3.2 Trying to Reduce Repetition in jQuery Ajax Remote Forms

I have developed a back-end in Rails 3.2 that allows admins to perform CRUD operations using ajax and jQuery. I have done this with several controller/views using js.coffee files to handle the ajax. ...
1
vote
1answer
269 views

Coffeescript and problems with encodings of Ruby 1.9

A basic task: evaluate field's value and show warning if results are not satisfying. The actual code doesn't matter, since it works perfectly until I actually change sample warning's test to the one, ...
0
votes
1answer
233 views

Rails 3.2 ActiveRecord Database Field Issue

I have a rails 3.2 application where I have a table called menu_items. My rails application barks when I read data that has an apostrophe in it (ex "Devil's food cake"). I am able to input the field ...
0
votes
1answer
333 views

Using .css.scss variables in jQuery?

I am working on a Rails 3.1 app and am happily using SASS and CoffeeScript. I particularly like the SASS extensions of variables and imports. I have constructed a single _global-settings.css.scss ...
2
votes
3answers
3k views

How to use rails code / pass variables to a .coffee javascript file?

What would be the best way to pass values inside a .coffee script? Renaming the file to .erb breaks my app so what are the alternatives?
0
votes
1answer
151 views

Bring Rails asset pipeline to any project?

Is it possible to bring the asset pipeline standalone to any project? I wrote an entire standlone client in CoffeeScript using the Rails asset pipeline (so it would automagically bundle my Coffee and ...
0
votes
1answer
66 views

Do i have to download or link jqueytools in ruby on rails 3.2

do i have to link the jquerytools js or download it, or is there a better possibility with coffeescript, like //= require jquery.tools.min.js or sth?
0
votes
1answer
333 views

Uncaught type error with CoffeeScript and Backbone.js

Rails app, learning CoffeeScript and Backbone.js: Uncaught TypeError: Cannot use 'in' operator to search for 'id' in easy _.extend.setbackbone.js:205 Backbone.Modelbackbone.js:142 Gamegames.js:13 ...
0
votes
1answer
55 views

Does sprockets mixin raw .js files or just coffeescript files?

Does the sprocket functionality only mixin .js.coffee files to the application.js or will it also add raw .js files?
0
votes
1answer
320 views

DOM Exception 8 error when implementing endless scrolling using mustache templates & jquery masonry

I am implementing an endless scrolling effect heavily influenced by this tutorial: http://railscasts.com/episodes/295-sharing-mustache-templates?view=asciicast However, I am doing it slightly ...
1
vote
1answer
318 views

Translate a JQuery-Javascript call to Coffeescript (Rails 3.1)

I am currently upgrading a Rails application. While I did manage to translate simpler JQuery calls, I got stuck with the more complex JQuery autocomplete. Javascript $(document).ready(function() { ...
2
votes
1answer
4k views

Uncaught TypeError: Cannot call method 'extend' of undefined

I am trying to get a CoffeeScript class to extend a Backbone.Model. I built a brand new rails 3.1 app, created a scaffold of 'Stone', with 3 attributes, and patched a snippet of the Todos.coffee ...
12
votes
3answers
3k views

How can I completely disable CoffeeScript in a Rails 3.1 app?

At the moment when I generate a new controller, Rails also generates a .js.coffee file for the controller as well. As I don't use CoffeeScript I want Rails instead generate .js files for me. Is it ...
2
votes
1answer
311 views

I get this error when I have coffeescript files in my assets/javascript folder

I get the following error when I have coffeescript files in my assets/javascript folder ExecJS::RuntimeError in Users/sessions#new If I remove the coffee script files, everything works ...
1
vote
1answer
161 views

How do I get extraParams to work with Rails 3.1 Coffeescript and Jquery

I need to pass extra params to my autocomplete URL. Below is my latest try although I have also tried various combinations with and without commas, curly braces, etc. The call works but I only get ...
2
votes
1answer
704 views

Get rails view helper methods inside coffeescript

I have a view helper, let say (for simplicity's sake) def call_alert return "alert 'this should appear'" end Then I have a coffeescript file some_test_page.js.coffee which renders for an action ...
0
votes
1answer
275 views

Rails 3.1 and Coffeescript: add links to set date select

Given a simple generic Rails form with a date_select (among other fields, I removed those in the code). I'd love to add links to this form named Yesterday, Today, Tomorrow, ... , Next Week. A click ...
0
votes
1answer
450 views

Rails 3.1 CoffeeScript/JQuery - How to change the source of an image in a div?

I would like to change the image of a link with jquery. This is what I tried : In my Haml file : .selected = link_to image_tag('/assets/unselected.png'), {:controller => Posts, :action => ...
1
vote
1answer
329 views

Unexpected 'LOGIC' in coffeescript template

Having this code in a view partial of type .js.coffee (it's being rendered as a view, not as an asset) : <% if @followed_car_ids.present? %> for car_id_and_path in <%= ...
0
votes
1answer
625 views

Error when trying to create Backbone.js view subclass

I have the backbone.js view below: class MyApplication.Views.Cake extends Backbone.View tagName: 'li' className: 'cake' and the attempted subclass class MyApplication.Views.AwesomeCake ...
1
vote
3answers
720 views

Rails 3.1 - what is the best way to access controllers' variables in coffeescript?

I am looking for a recipe to use the controller's global variables into a coffeescript like this : Controller : respond_to :js def create @commentable = commentable @comment = ...
2
votes
2answers
1k views

Cannot render coffeescript partial inside coffeescript

I want to make a general controller that can be called after the page was loaded (with AJAX) and update different stuff on the page depending on which controller called it. The purpose is to allow ...
3
votes
1answer
890 views

Spying on a Javascript constructor using Jasmine

I'm writing specs for some Javascript classes (backbone.js views, written in Coffeescript) and I'd like to ensure that one view constructs another. I'm attempting to do this by spying on the ...

1 2 3
15 30 50 per page