Questions tagged [rjs]

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

213 questions
1
vote
1 answer

RJS error "object doesn't support this property " on element update

I have the following code in the controller. I am populating a drop down box dynamically based on the selection from another drop down box. def update_releases project = Project.find(params[:project_id]) releases = project.releases puts…
ramya
  • 928
  • 5
  • 14
  • 30
1
vote
2 answers

Multiple dependent dynamic select boxes in form

There is a model A that has_many B and a form where one can create a new A and add/remove Bs. I.e. there is a link Add new B that runs some Javascript to insert another partial where one fills in values for B. All works fine. The problem Specifying…
murrekatt
  • 5,961
  • 5
  • 39
  • 63
1
vote
0 answers

RJS error in rails

I am working in rails 2.3.8 and I got following rjs error in my rails application. RJS error: TypeError: $("#create_event_dialog") is nul Then I click ok, then come another one. Element.update("create_event", "
Rosh
  • 730
  • 2
  • 12
  • 32
1
vote
6 answers

Rails: link_to_remote update doesn't render the view

I have a link_to_remote to render the edit action of an object. But all it does is update the Dom Element with this response try { } catch (e) { alert('RJS error:\n\n' + e.toString()); alert(''); throw e } My link looks like this: = link_to_remote…
Ole Spaarmann
  • 15,845
  • 27
  • 98
  • 160
1
vote
1 answer

YUI3 Uploader + Rails rjs

I'm trying to use the YUI3 Uploader with a Rails 2.3.12 project. I've got it working up to the point of parsing the response after uploading. The response is an RJS file rendering a partial, to update an element on the page. This RJS works as…
jemminger
  • 5,133
  • 4
  • 26
  • 47
1
vote
1 answer

calling application prototype js function from rjs

Is it possible to call an application level prototype JavaScript function from rjs? I wanna call a function to perform certain tasks after my ajax call. How am i supposed to do it?
Rahul
  • 44,892
  • 25
  • 73
  • 103
1
vote
2 answers

Redirecting main window from ajax call

I have a ajax call to a controller that checks for authentication, when no authentication exists it sends the call onwards to the signin controller who checks if it is a xhr request. If it is it renders an rjs containing a page.redirect_to to the…
nenne
  • 165
  • 2
  • 9
1
vote
2 answers

RJS error: [object Error] in IE 8 on RJS response from rails/scriptaculous

I have a controller with: render :update do |page| page.replace_html 'some_id', :partial => 'some_partial' end It works fine in firefox, but IE throws an "RJS Error: [Object error]" Looking at the generated javascript, it look like…
Jeppe Liisberg
  • 3,734
  • 3
  • 25
  • 24
1
vote
2 answers

What defines RJS? confused with what I have Read

I am a little confused from what I have read on stackoverflow regarding RJS. Many people have stated that Rails 3.0 has dropped RJS for UJS .This statement confuses me because from what I understand the difference between obtrusive (inline) and…
user427165
1
vote
1 answer

RJS Conditionals based on Element Style - Ruby on rails

I have some RJS in a rails app. I'd like to be able to check the style of an html element before executing an action on that element. I have tried the following page << "if ($('current_thread_partial').style.display != 'none'){" …
slotishtype
  • 2,715
  • 7
  • 32
  • 47
1
vote
1 answer

Rails Ajax single line RJS files

Everything I am reading about rails 3 and AJAX says that we should have respond_to do |format| @wines = Wine.all(:conditions => {:category => "Sparkling"}) format.js end and then a seperate js.erb file that is $("wines").update("<%= …
Lee Quarella
  • 4,662
  • 5
  • 43
  • 68
1
vote
1 answer

Is it possible to pass local variables like ':locals => { :f => f }' using RJS?

In my 'ROOT_RAILS/views/accounts/new.html.erb' I have <% form_for(@account, :remote => true, :url => accounts_path) do |f| %> <% end %> and I am trying to use RJS in…
user502052
  • 14,803
  • 30
  • 109
  • 188
1
vote
1 answer

Is there a way to call a Rails 3 function from a link_to tag, using :remote => true?

In my Rails 3 app, I have a list of questions. Each question has a "question number" which designates its order in the table/list. I'm trying to implement a "Move Up" link that will decrement that question's number to move it up in the list (1 is at…
Sarah
  • 516
  • 10
  • 35
1
vote
2 answers

How to create an OnChange "totaling" function from an unknown number of text fields

I'm having trouble figuring out how to do a simple Javascript task on fields in a table created with Rails 3. My table has characteristic rows that the user adds using a form below (which updates the database and reloads the table partial). The…
Sarah
  • 516
  • 10
  • 35
1
vote
2 answers

RubyOnRails 2.2 + Jquery UI Sortable & AJAX: This is how I did it. Is there a better way?

In a Rails 2.2 project, I'm having users put together a list of projects into a portfolio object (i.e.: PortfolioHasManyProjects). On the page is a Rails form for regular text, titles etc., as well as 2 sortable lists; the lists are used for…
DarkClimate
  • 11
  • 1
  • 2