Displaying 20 results from an estimated 7000 matches similar to: "RJS throwing 'rubycode' exception"
2006 May 17
0
RJS referring to window.parent
Hi all,
I''ve been doing some work on the Ajax Scaffold
(http://www.ajaxscaffold.com/), to make it work with file uploads
(more specifically, the file_upload plugin).
The first logical step was to get rid of form_remote_tag, since it''s
impossible to send files via XMLHTTPRequests (to my best knowledge).
So I referred to the iframe hack, similar to the upload progress bar
here
2006 Mar 31
5
RoR 1.1 RJS problem
I''ve been playing with the new RJS stuff in RoR1.1, and I have to say
that I''m am extremely impressed, NICE! work guys. However, I seem to be
having a bit of a problem. I promise, I''ve googled the hell out of it
and haven''t found an answer.
Set up: Putting together a little proof of concept app. Display a form
(index.rhtml) that just has a button to
2008 Oct 29
0
RJS problem after upgrading to Rails 2.0.2
I just updated an old app from 1.2.6 to 2.0.2 and I''m having an rjs problem.
I have one page that has 2 submit to remote buttons, one to do a price
override and the other to remove the lineitem. Everything is working
perfectly before the update but now the price override doesn''t update the
page. I''ve verified that the price_override method still gets called
because
2006 May 12
0
RJS, Safari, Error - DOM exception 7
I''m having nasty cross-browser headache.
Not new to Rails, but quite new to AJAX/RJS.
My app works perfectly in Firefox, but generates
the error in the subject line in Safari.
Pretty simple circumstance, completely reproducible
in all cases:
Any ideas? Relevant code attached.
Layout:
-------
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC
2011 Sep 14
5
rjs error TypeError: element.getElementsByTagName is not a function in rails 3+jquery
hi,
i am using rails 3.0.10
i am trying with sample application for searching data from table and
updating
my search.html.erb file is
<%= form_for (@employee) do |s|%
<div id ="search_details">
<%= s.text_field :name%>
<%= s.text_field :emp_id, :onfocus =>
''sal(document.getElementById(''employee_name'').value);''%>
2009 Feb 20
6
How to mock an object defined in the before_filter function?
Hello,
I am trying to implement the following scenario, but I am stuck ...
The thing is I want to initialize a variable @comment when the stub
function "find_comment" is called.
The way I do it below doesn''t work, since
"before_filter :find_comment" returns true/false and @comment
initialization is done inside it. Could you please give me a hint how
to do it?
One
2006 May 12
7
RJS and page.select collection size
I need to implement a conditional in my RJS template which looks
something like:
if (page.select(''row1'').first != null)
page << "new TableRow.MoveAfter(''row1'', ''newrow'');"
else
page << "new TableRow.MoveAfter(''row2'', ''newrow'');"
end
Now, dumb question.. My
2006 Jan 13
1
Rendering an RJS template within another RJS template
Is there a way to render an RJS template within another?
I''ve put my simplified code below. No errors are generated, but the
partial isn''t rendered. I also tried using render :action =>
''update_actions''
destroy.rjs---
page.visual_effect :fade, comment_container(@object.id.to_s)
# update the number of comments(below is another rjs template)
render :partial
2006 Feb 14
2
Inline list editing with RJS: best practices
I wanted to get the community opinion on the best way to use partials and
inline list (<li>) editing.
I have a very common scenario where a list is rendered:
--- index.rhtml ---
<ul>
<%= render :partial => ''item'', @collection => @items %>
</ul>
--- _item.rhtml (simplified) ---
<li id="item_<%= item.id %>">
<div
2006 Mar 14
2
RJS & Unicode (again)
I have a problem with unicode & RJS. I searched several boards & blogs,
but was not able to find a solution. Let me explain my problem with an
example.
View (test.rhtml):
...
<div id="a_test_div">?????????</div>
...
Output:
?????????
RJS-Template (an_action.rjs):
page.replace_html ''a_test_div'', ''?????????''
Calling
2011 Oct 07
0
will_paginate + RJS error
Hi there!
I need some help, I''m new to rjs + will_paginate and don''t know how
to
solve this problem.
The application apparently is working fine, the partial is rendered
by the javascript, the pagination works fine, but sometimes, when I
hit the next page number or " next >>", it reders the code below.
Im using rails 2.3.8, ruby 1.8.7. and will_paginate 2.3.15
2007 Jan 29
6
RJS problem
Hi,
I''m implementing a "digg-like" page, that once you digg. The score for
each item will dynamically reflect your current action +1 .
I am not sure what''s
In the controller I have an action responsible for increase of the
score.It has a corresponding rjs in view.
--------------------------------------------------------------------------------
def arouse
2006 Nov 04
0
RJS not setting form input value correctly
Good day.
I have spent almost 2 days on this issue.
I have asked everyone from my Rails expert to my Javasript expert and we can
not for the life of us figure out the issue with this one form element.
I have a form which contains several readonly/disabled (firefox/ie) form
elements.
ALL elements in the form are updated correctly EXCEPT this one form element.
The form element in the view looks as
2005 Dec 19
1
Preserving fallback with RJS
Hi guys,
I really like RJS. I think they''ll replace partials in alot of
instances. Unfortunately, because they''re automatically used like
.rhtml and .rxml and are hard to specifically specify it makes it
messy to preserve fallbacks when using them. For instance, using
partials instead of rjs, my create method might look like:
def create
post = Post.new(params[:post])
...
2006 Apr 02
2
Focus on ajax newly-created form element
I have an ajax method that creates a new form. I want one of the
input boxes to be focused when the form gets displayed. So in my
inline RJS I have
page << "document.getElementById(''post_title'').focus();"
The input box is being created with
<%= text_field ''post'', ''title'' %>, so the ID should end up being
2006 Jun 21
2
Using RJS to highlight one LI if using insert_html on an UL?
It seems common to use RJS for quickly adding and highlighting a list
that is having content added to it like this:
http://rafb.net/paste/results/Z3m32g48.html
... where "my_list" would be an UL and the partial would insert a LI.
Given that example, is there an easy way to highlight only the newly
inserted LI instead of the whole UL? The only way I can see to do it is
to give
2010 Jul 27
7
trouble with remote_form_for & html_update
I have a form that accepts comments and adds them to a list without
refreshing the page.
This is the html:
<div id=''aremark''>
<%= render :partial => ''comment'' %>
</div>
<% remote_form_for :comment, :url=>story_comments_path(@story), :html
=> { :id => ''comment'' } do |form| %>
<h5><label
2006 Apr 22
3
rjs woes, any hints?
I''ve pared my rjs experiment down to what seems a bare minimum. When I click
on my link_to_remote, the rjs executes, returns the correct javascript to
the browser, but it doesn''t update the div I''ve specified. What appears to
be coming back from the controller is:
Element.update("my_form", "hello, rjs");
I''m tearing my hair out.
2006 Jun 06
0
Get value from form using rjs, and problem with Safari
Hi,
I have got two forms, the first is a textarea plus a link that activates
some javascript to change the form, the second activates some javascript on
the onchange event which changes it into a textarea form.
This works in Firefox, but not in Safari.
Also, I need the value which is selected. I''ve found an example that gives
the parameter to the javascript, like this:
<input
2006 Mar 31
3
RJS templates outputting bloated code?
I''m an RJS newbie. I just did the tutorial at
http://www.codyfauser.com/articles/2005/11/20/rails-rjs-templates, and
then used wget to look at the output the RJS template generates. This is
what I got:
try {
new Insertion.Bottom("list", "<li>Fox</li>");
new Effect.Highlight("list",{duration:1});
Element.update("header", "RJS