Ruby Javascript Generator Templates. Uses the file extension .rjs. Not related to r.js.
Questions tagged [rjs]
213 questions
2
votes
2 answers
RJS Handler missing
I got a missing template error when I tried to achieve a task using RJS.
All I want is to execute an RJS file on ajax call. But I am getting the
following error.
ActionView::MissingTemplate (Missing template line_items/create,
application/create…

Jithin
- 2,594
- 1
- 22
- 42
2
votes
1 answer
How to do complex forms with jQuery instead of RJS
In episode 74 of railscasts ryan shows how to achieve complex forms with RJS: http://railscasts.com/episodes/74-complex-forms-part-2
The trick is to create a partial and link_to the partial using RJS. The episode is quite old and at that time…

Mike
- 1,361
- 2
- 13
- 13
2
votes
3 answers
How to change html tag attribute value from RJS template?
Is it possible to change a html tag attribute value from an RSJ template?
I know that there is a page.replace_html method, but it is not very useful in my case, since I have lengthy values of various attributes (such as alt, title of an image).
What…

Valentin V
- 24,971
- 33
- 103
- 152
2
votes
1 answer
Rails 3.1 prototype-rails
Can the new prototype-rails gem for Rails 3.1 which allows RJS and prototype support also be used with JQuery-UJS to allow JQuery to be used with RJS that is JS templates and its helpers?
To confirm : I dont wish to use prototype I want JQuery to…
user427165
2
votes
1 answer
RJS in Play Framework
have anyone found a substitution for RJS in "Ruby on Rails" for play?
P.S.
I don't mean just a tag with script section.
I mean real server-generated JavaScript-file.

dsf
- 23
- 2
2
votes
5 answers
RJS: Using observe_field on select_tag
The dropdown-menu (built by the select_tag) in my application should call the filter-category-action as soon as the user changes the value in the dropdown-menu AND hits the 'Go' button.
Now I'd like to get rid of the 'Go' button and have an…

Javier
- 2,491
- 4
- 36
- 57
2
votes
2 answers
Rails Error submitting partial via Javascript
I have the following code in my controller:
File: app/controllers/photos_controller.rb
def show_snapshot_comments
snapshot = Snapshot.find(params[:id])
@photo = snapshot.photo
comments = snapshot.comments.paginate :page => params[:page]
…

webbydevy
- 1,200
- 3
- 15
- 21
2
votes
1 answer
How to replace the div in Rails 3 using AJAX?
I was trying to replace my div in DOM using RJS. Here is the code i tried,
The controller has this method:
def change
render :update do |page|
page.replace(:test_id, :partial => "input",:locals =>{ :type => 'text', :name =>…

Aashish P
- 1,894
- 5
- 22
- 36
2
votes
2 answers
Jrails and jquery-rails together?
I hope you forgive me if I'm a little confused about this.
Jrails rewrites all the helper methods for rjs otherwise in prototype.
Jquery-rails overrides rails.js (so I taught the rjs helpers as well, but I see it's not) and the rest of the libraries…

ecoologic
- 10,202
- 3
- 62
- 66
2
votes
1 answer
How to access view helpers from RJS helpers in Ruby on Rails?
I had some common bits of RJS that I was repeating in multiple RJS files, and so wanted to put it into a helper.
I added a method to app/helpers/application_helper.rb just like I would normally for an html.erb file. The method works, except that it…

travis-146
- 1,075
- 1
- 10
- 20
2
votes
1 answer
RJS: How to get the value and innerHTML of a DOM element
I want to assign the value and the innerHTML source of a DOM element to the local ruby variables.
However, in my method seemly i can not make use of the RJS to complete this function.
I don't know which method can implement it, in one words is: to…

squirrelRao
- 137
- 1
- 10
2
votes
2 answers
RoR: Multiple remote_function calls on single :onclick
I have two different methods that I want to execute when a user clicks a button. I have them working separately, but when I try to combine the two I get errors. The two ones I have currently are
<%= image_tag('go_button.png',
…
Splashlin
2
votes
2 answers
Rails 3 Link_to :remote is not triggering RJS
I'm working to setup an AJAX action in rails 3 with the following code. The AJAX part of the code seems to work, but it does not request the correct file and my respond_to serves it the regular HTML.
The routing information:
resources :zones do
…

voxobscuro
- 2,132
- 1
- 21
- 45
2
votes
1 answer
Rails Ajax Hide/Show Toggle Link using RJS
I want users to be able to comment on submissions. Below each submission I want there to be a link that says "Comments (2)"...when you click on this link it dynamically loads in the comments, as well as a simple form to add a new comment. When the…

goddamnyouryan
- 6,854
- 15
- 56
- 105
2
votes
3 answers
How to reload a div using render(:update) and replace_html?
How to reload only the div id on a page?
I just need to reload a certain div.
in my controller I have
def mycontrolleraction
...
render(:update) do |page|
reload_only_the_div('adiv'), :controller => 'my_controller'
end
end
Is this possible?
jbjuly