How to access the Var or function from a Javascript file in a rails function?

12 views
Skip to first unread message

sunec...@gmail.com

unread,
Jul 7, 2013, 8:45:45 AM7/7/13
to rubyonra...@googlegroups.com
Hi!  I am supposed to process the specified data in my database.So this is what i am doing. First, I get the "id" attribute of the objects that i will use by checkbox. Then, I will search the database to get the objects according to the "id" list. 
But, here is my problem, I can get the "id" list, but I don;t know how to get the objects thtough the list, for the function"getPendingList" to get "id" list is in the "js" file, the function "pendingAll(list)" to get the object is a rails helper function, when i call back the  "getPendingList" like " pendingAll( getPendingList) ",it says can't find the getPendingList. 
Any advice will be appreciated, thank you~

Colin Law

unread,
Jul 7, 2013, 1:27:18 PM7/7/13
to rubyonra...@googlegroups.com
I am afraid I, for one, cannot make any sense of your question.
Firstly, are you an experienced Rails developer? If not then I
suggest working right through a good tutorial such as
railstutorial.org (which is free to use online). Then, if you still
cannot answer your own question try again to ask the question and show
us the section of code that is not working (not the whole app, just
the few lines around the problem).

Colin
Reply all
Reply to author
Forward
0 new messages