Displaying 20 results from an estimated 3000 matches similar to: "Can :before and :success move from view file into .rjs file?"
2006 Nov 02
5
RJS error in internet explorer
hey all,
got a rails app i''m finishing up. i have a little ajax on one of my
pages where the person can choose a doctor from a drop down list and if
the doctor isn''t there they can click a link which blinds down a little
form to add a doctor. after they submit that mini-form the page updates
the div which houses the drop-down so the doctor shows up. works very
nicely IN FIREFOX.
2005 Dec 25
5
RJS not working?
I''ve been attempting to add a simple rjs ''delete'' method to my
project. However, no matter what I try, it simply doesn''t work. Even
the easy, easy stuff seems broken. (Yes, <%=
javascript_include_tag :defaults %> is being included in the template.)
For example, from:
http://www.codyfauser.com/articles/2005/11/20/rails-rjs-templates
VIEW:
<h1
2006 Apr 05
23
how to create RJS visual effects callbacks
I''m trying desperately to get visuall effects callbacks working in rjs
templates to no avail What I''m trying to do is fade an image, change
the div with the image to a new image, and then fade the new image back
in. How would I go about this in RJS Here''s a simple line from my rjs
that I can''t get to work. It is not using callbacks so the
2006 Jan 28
1
Help with multiple actions
I got a question I currently have a form_remote_tag and in it, I would like to
include two :before actions such as :before => %(Element.show(''item'')), :before
=> visual_effect(:blind_up, ''window'') but if I have them as such the last
:before is executated and the first one isn''t, how would I be able to have them
both execute when the :before
2006 Apr 05
7
Conditional toggle button
I have a link_to_remote that updates the content of a hidden div and
makes it appear.. But I want it to hide the div and not execute the
link_to_remote function on the second click. What''s the best way to do
this? I''m thinking I can do it in RJS maybe, but I''m not sure if
there''s a nice Rails-y way to tell if a div is hidden or not..
I''d also
2006 Apr 03
5
RJS Queue
Hi,
I''ve been able to succesfully queue page.visual_effect commands in my
RJS templates. Each command will wait to execute until the previous
command is done executing.
But I''d also like to execute a page.replace_html command AFTER the
page.visual_effect commands. I have a series of five DIVs:
div1
div2
div3
div4
div5
When the user clicks on div1, a page.visual_effect
2008 Jan 23
11
Rails 2.0.2 + RJS
Hi
I had ajax commenting on my app, which worked perfectly on Rails
v1.2.6, but does not work the same in Rails 2.02. Basically the
comment gets added, but the visual effects do not work (ie lines 2 + 3
of create.rjs)
create.js
page.insert_html :bottom, ''comments'', :partial => ''comment''
page.visual_effect :appear, "comment_#{@comment.id}"
2006 Jul 20
5
RJS where to put helper method?
Hi,
If I want to have helper method for my rjs, where''s the best place to put
it?
so for example:
--- bla.rjs:
page.replace_html ...
page.visual_effect ...
--- somewhere: (currently I put in application_helper.rb)
def replace_with_effect(page)
page.replace_html ...
page.visual_effect ...
end
--- bla.rjs:
replace_with_effect page
and is there a way to define the helper so we
2006 Jun 26
1
RJS visual_effect toggle?
Is there a way to toggle an effect in an RJS? If not, anyone have
recommendations for how to manually make it toggle? I guess I would
assume some boolean that the rjs checks everytime it''s called and
depending on whether it''s true or false it will do page.visual_effect
:appear or page.visual_effect :hide
-Ben Lisbakken
--
Posted via http://www.ruby-forum.com/.
2006 Apr 27
7
RJS & Ajax question...
Hi,
I''m trying to convert an older Rails application to use Ajax. I''ve
already moved my edit and show actions so that, instead of displaying as
separate pages, they appear in a <div> on my list view.
However, I have two problems:
1) When the user saves the changes, I want to put all the ajax changes
in an RJS template. However, form_remote_tag :url =>{:action =>
2006 Jan 19
1
rjs problems
Hi,
I am having trouble with rjs templates. Basically I want the item_div
to fade if its already open and then display the new item that the
user selected with the visual effect: appear. The code below causes
the browser (firefox on osx) to open the div and then close it again
as soon as it is open:
page.visual_effect :fade, ''item_div'', :duration => 0.5
page.replace_html
2006 Aug 25
3
RJS Error: Element.update is not a function
Hi,
I have implemented some RJS code and I have the same exact code in 2
different places. In one place I get the error "Element.update is not
a function" and the other place works fine. Any idea why this error is
coming? Breaking my head.
-Vinod
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on
2006 Jul 06
2
rjs rails to execute?
I have the following:
layout:
<%= javascript_include_tag :defaults %>
[...]
<div id="menu">
<div id="myrandom"></div>
<%= render :partial => ''menu'' %>
</div>
menu partial:
<%= link_to_remote "Generate Text",
:update => ''myrandom'',
:url => { :action =>
2010 May 24
2
Two RJS visual effects will happen at the same time?
I was going to change the background of a div from white to red and then
from red back to white, so this is used in an RJS file:
page[:vote_score].visual_effect :highlight, :startcolor => ''#ffffff'',
:endcolor => ''#ffcccc''
page[:vote_score].visual_effect :highlight, :startcolor => ''#ffcccc'',
:endcolor =>
2006 Jul 31
4
RJS to find an element
I''m trying to implement a remove from cart method based on the
examples in the second edition Agile book. I have everything working
except for the RJS that removes items from the cart. Ideally what
I''d like to do is highlight an element that I am deleting only if
there is more than one of that particular item in the cart. If the
item deleted is the only of
2006 Jan 22
3
"onload" event handler inside a div
Hi. I need help on what is essentially putting an "onload" event handler
into a div. I am using render :partial and when the partial is loaded, I
would like the divs to show using an effect from a library such as
scriptaculous or moofx. However, there is no "onload" for a div. I was
wondering what alternative methods I should use to achieve this.
Thanks!
--
Posted via
2006 May 08
3
Can you apply effects to elements create in same RJS file?
I am trying to create a new element in a list and highlight it.
I am doing the following in my rjs file:
page.insert_html :after, ''bananalist_header'', :partial => ''banana''
page.visual_effect :highlight, "banana#{banana.id}", :duration => 1
The first line creates a new element with the id= ''banana3'' say...
The second line then
2006 Aug 07
2
.rjs not run unless I manually set the Content-type header
I''ve got this is my controller
def destroy
@headers[''Content-Type''] = ''text/javascript; charset=utf-8''
end
and this in my .rjs file called destroy.rjs
page.alert(''test'')
page.visual_effect :shrink, ''tip_''+params[:id], :duration => 3
This works, *unless* I uncomment the Content-Type line in the
2006 Apr 21
3
rjs in multiple ajax page
Sorry for the long explanation but I''m having trouble integrating rjs into my
form page. Here''s my page:
<div id="posts">
<ul id="post_list"><%= render :partial => ''list_results'', :collection =>
@posts %></ul>
<p><%= link_to_remote(''+'',
:url => {:action =>
2006 Mar 08
2
RJS - page object in helpers?
Hello,
I am using RJS and Edge Rails and I was wondering if the page object should
be available in helpers also.
For example if I have a helper function
def update_flash_messages
page.replace_html ''flash_messages'', (show_flash_messages :textilize => true)
page.visual_effect ''flash_messages'', :appear
end
and then in my RJS files I call