Questions tagged [rjs]

Ruby Javascript Generator Templates. Uses the file extension .rjs. Not related to r.js.

213 questions
2
votes
1 answer

How to disable Rails submit buttons alongside Prototype helpers & RJS?

I'm trying to follow this post How can I unobtrusively disable submit buttons with Javascript and Prototype? but I can't get it to work. The form triggers an RJS function, so I need to keep the helpers' onclick events intact. The RJS…
Jesse
  • 1,019
  • 2
  • 14
  • 25
2
votes
2 answers

RJS error: TypeError: element is null

I got RJS error: TypeError: element is null while using ajax. I used in view <%= periodically_call_remote(:url=>{:action=>'get_user_list', :id=>'1'}, :frequency => '5') %> in controller render :update do |page| page.replace_html …
Salil
  • 46,566
  • 21
  • 122
  • 156
2
votes
2 answers

Confused as to which Prototype helper to use

After reading http://api.rubyonrails.org/classes/ActionView/Helpers/PrototypeHelper.html I just can't seem to find what I'm looking for. I have a simplistic model that deletes the oldest message after the list of messages reaches 24, the model is…
66tree
  • 579
  • 7
  • 29
2
votes
1 answer

RJS returns plain javascript without JS tags

Here is code on view in FeesController "show" action template:
<%= link_to_remote('New payer', :update => "payers_controls", :url => new_payer_url) …
BlackTea
  • 1,274
  • 15
  • 27
2
votes
4 answers

How can I use different RJS templates from the same rails controller?

I have a controller method that returns a list for a drop down that gets rendered in a partial, but depending on where the partial is being used, the RJS template needs to be different. Can I pass a parameter to the controller that will determine…
Kyle Boon
  • 5,213
  • 6
  • 39
  • 50
2
votes
1 answer

Question regarding RJS and usage of link_to_remote

I was working on my website when I cam across this problem, I have 100 posts in my blog and I am paginating them 10 at a time, I display the 1st 15 and display a link at the bottom which basically is implemented using the link_to_remote tag. <%=…
Shiv
  • 8,362
  • 5
  • 29
  • 32
2
votes
1 answer

yeoman build fails - rjs mainConfigFile location

yeoman server works fine, but yeoman build looks for my main requirejs file in a strange place and fails: Unable to read "scripts/scripts/main.js" file (Error code: ENOENT). Use --force to continue. It seems to add that extra…
Justin McCandless
  • 621
  • 1
  • 10
  • 20
2
votes
3 answers

doing a remote => true call with javascript

Is there a way to have the same behavior as a link_to ... remote=> true with javascript? maybe it's not necessary - I have a div with the user's name and picture in it. I want to have the entire div to react to a click and go to the method…
Nick Ginanto
  • 31,090
  • 47
  • 134
  • 244
2
votes
1 answer

rails autocomplete question about removing extraneous info

I've got my autocomplete plugin working perfectly... except I have certain info that I want displayed in the autocomplete divs, but I don't want to end up when the user makes their selection. Ie... I have an auto complete for currencies... they can…
holden
  • 13,471
  • 22
  • 98
  • 160
2
votes
2 answers

Ajax and Json with Rails

I followed Hartl's Rails tutorial where he does Ajax using RJS and sending javascript in the response to be executed on the client side to edit the DOM. But what do you do if you want just JSON sent in the response and not send javascript. This also…
user782220
  • 10,677
  • 21
  • 72
  • 135
2
votes
2 answers

Passing objects from Rails RJS to a javascript function call without quoting the values?

In a Ruby on Rails project I need to have a JavaScript function executed at the end of an Ajax call. My problem is that the values being passed into the JavaScript function being called with page.call are being wrapped up in quotes. Not too much of…
DL Redden
  • 578
  • 1
  • 5
  • 13
2
votes
2 answers

The modification of the checked attribute of a checkbox doesn't work correctly

I have a rails view that displays a checkbox. When I click on the checkbox, a rjs function is called in my controller and it checks or unchecks the checkbox according to its previous state. In the view : <%= check_box_tag 'checkbox_test' %> <%=…
Jerem
  • 191
  • 1
  • 9
1
vote
1 answer

RJS : Retrieve the value of a text_field

I am using Rails 2.3 and I don't know how to retrieve the value of a text_field of a form in order to handle it in the rjs file. I searched on the Internet all day and I didn't find a solution. Here is my code to be more specific : In my form.erb…
Jerem
  • 191
  • 1
  • 9
1
vote
4 answers

Running a rails RJS template from a jquery get request

I am using Rails and jquery with RJS templates to perform various AJAX requests. For most of my Ajax stuff I attach a submit handler to the form in my application.js as…
Darren Greaves
  • 3,326
  • 4
  • 29
  • 32
1
vote
1 answer

link_to_function does not react to click in rails 3.1.0 & simple_form

Here is the code in rfqs/_form_new.html.erb to add a selection box for standard. <%= simple_form_for @rfq do |f| %>
<%= render :partial => 'standards/standards', :collection => @rfq.standards, :locals => { :f => f } %> …
user938363
  • 9,990
  • 38
  • 137
  • 303