Tagged Questions
37
votes
6answers
48k views
Facebook how to check if user has liked page and show content?
I am trying to create a Facebook iFrame app. The app should first show an image and if the user likes the page, he will get access to some content.
I use RoR, therefore I can't use the Facebook PhP ...
70
votes
6answers
20k views
Best way to add page specific javascript in a Rails 3 app?
Rails 3 has some unobtrusive javascript which is pretty cool.
But I was wondering what the best way is to include additional JS for a particular page.
For example, where I might have previously ...
52
votes
6answers
23k views
Rails - Could not find a JavaScript runtime?
I created a new Rails project using rails 3.1.0.rc4 on my local machine but when I try to start the server I get:
Could not find a JavaScript runtime. See here for a list of available runtimes. ...
12
votes
2answers
2k views
Capybara with :js => true causes test to fail
I'm new to Capybara and testing on Rails in general, so please forgive me if this is a simple answer.
I've got this test
it "should be able to edit an assignment" do
visit dashboard_path
...
27
votes
4answers
5k views
Using a Rails helper method within a javascript asset
Is there any way to use a Rails helper method, more specifically, a path helper method within a javascript asset file. This file foo.js.coffee.erb
$('#bar').val("<%= create_post_path %>")
I ...
6
votes
3answers
2k views
Scoping the results for rails3 jquery autocomplete plugin
I'm using https://github.com/crowdint/rails3-jquery-autocomplete and it seems to be working. The only problem is lets say I have a field performing an autocomplete on all post titles, but I want it to ...
3
votes
6answers
34k views
link_to syntax with rails3 (link_to_remote) and basic javascript not working in a rails3 app?
i am wondering if the basic link_to syntax is completely broken in current rails3 master or if i am doing some wrong syntax here.
= link_to "name", nil, :onlick => "alert('Hello world!');"
...
0
votes
1answer
101 views
Issue with Ajax Appending
I have a comment model that is paginated and I would like the comments to load more comments on the same page whenever the next button is clicked. I have somewhat of an idea of how to go about doing ...
2
votes
1answer
611 views
Repopulating dates on select boxes
I've created a date_select in Rails (which is 3 select boxes: one for year, one for month and one for day).
To have 31st February on them is quite confusing. What I want to be able to is to have the ...
2
votes
2answers
4k views
how to fix 'jQuery is not defined' error in jquery library?
Update: I'm going to close this question since it appears to be an issue that is specific to Rails and I got a downvote. What threw me off here was that those 2 lines aren't new, but suddenly I was ...
2
votes
4answers
1k views
javascript not running on heroku with rails 3.1
I've migrated a rails 3.0 app to 3.1 on Heroku. It's running on the cedar stack and everything is fine except that the app's javascript won't run. The application.js file is compiled and looks just as ...
1
vote
1answer
285 views
Linking to show view with Ruby in application.js file
I dynamically generate the title of a video from the embedly API in my application.js file with:
$(this).parent().prepend('<p>'+ oembed.title + '<p>');
Bear in mind that code is taken ...
20
votes
2answers
3k views
Route helpers in asset pipeline
using Rails 3.1.0.rc4, I'm trying to access a route helper in a javascript file (event.js.erb in this case) and it seems like they are not loaded at that moment. When requesting the merged ...
7
votes
4answers
926 views
back button in browser not working properly after using pushState (in Chrome)
I am using this type of line in an JS response
if (history && history.pushState){
history.pushState(null, null, '<%=j home_path %>');
}
but when I click back in the browser, I ...
5
votes
1answer
502 views
Issue with will_paginate page links
I currently have a comment model that posts under a micropost and both are displayed on the same page. The issue is that both are displayed on the same page and both are paginated and I am trying to ...