Sign up ×
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them, it only takes a minute:

This one is simple. lets say i have a model

class Post < ActiveRecord::Base
   attr_accessible :author, :content, :title
end

and i want to get instance variables of this class with coffeescript, put those into an array, and work on them. Is there any special method for this out there?

share|improve this question
    
Some less generic example? – Michal Szyndel Jul 18 '13 at 9:49
    
i dont think there is really need for this, all i need is information how to get Post.scoped.where(id == 2) into coffescript variable and thats it – Leo Jul 18 '13 at 9:52
    
There is need as there are million ways to do so. – Michal Szyndel Jul 18 '13 at 9:54
    
i dont know what to tell you, my real life issue isnt really more complicated than what i gave you:/ – Leo Jul 18 '13 at 9:56
    
Come on. You write a post model, so this is some kind of blog? Simply describe your app! :) – Michal Szyndel Jul 18 '13 at 9:59

1 Answer 1

Highly debatable but I'd advise you to use gon as a quick setup. It's even described in this Railscast.

Later you'd rather do ajax calls.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.