Displaying 20 results from an estimated 10000 matches similar to: "question about ajax/rjs and redirection"
2006 Mar 24
2
ajax redirection
Hi,
Is there a simple way to redirect towards another page (controller, action)
when using form_remote_tag ?
I used it tipically to check fields of a account login form. I''d like
if the user
exists, he''s redirected towards another page, otherwise I display some
error div''s.
Any ideas ?
Thanks a lot.
Seb
2006 Apr 01
3
Can I do a redirect in an ajax request?
I''ve got a form on my page, and when the user submits it, sometimes
I''d like to update an element on my page, and sometimes I''d like to
redirect the browser to another url entirely. However if I do
redirect_to, it just updates the element with the results of the
redirect. Is it possible to do what I want, or will I need to use RJS
to do this?
Pat
2006 Mar 23
2
ajax replace div
Hi,
Using form_remote_tag methode, is there a clean way to
directly replace the content of a given div instead of just update it ?
If I destroy the content of the div using this code:
:success => ''$(\''mydiv'').innerHTML = \''\'''',
It works. But it''s not really a clean way...
Any suggestions are very welcome..
Thanks.
Seb
2006 Mar 20
4
Ajax.Request w/standard redirect doesn''t render
I am doing an Ajax call in my page to a controller method like so:
new Ajax.Request(''<%= url_for(:action => "target_list_add" )%>'', {
asynchronous:true });"
In my controller method "target_list_add", I do something and then I
say:
redirect_to( :action => ''target_list_upload'', :layout => false )
I know for certain
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 Apr 27
12
Execute controller function from RJS
Hi all,
I wonder if it is somehow possible to execture or redirect to a
controller function from RJS?
Right now I do:
def foo()
render :partial => ''executeagain''
end
_executeagain.rhtml
<script>
new Ajax.Updater(''elmntID'', ''/test/foo/'', {evalScripts:true});
</script>
This will loop I know :)
How can I achieve the same
2006 Aug 03
1
Why doesn''t redirect_to handle rjs?
Is there a good reason why redirect_to doesn''t check responds_to, so
it can handle redirects in rjs calls? I''ve done something like this
in my app controller, seems to work ok...
alias_method :redirect_to_orig, :redirect_to;
def redirect_to(options = {}, *parameters_for_method_reference)
respond_to do |accepts|
accepts.html do
redirect_to_orig
2006 Jan 26
2
link_to_remote > in :action , interrupt ajax to render a new page outside the :update div ?
Hello,
I have a simple link_to_remote that refresh a div. I just want to know
if it''s possible to interrupt the div''s refresh inside :action to
perform a complete reload of the page, outside of the div
Actually, I havea a new page, but loaded inside the ":update" div.
Someone have an idea please ?
the rhtml:
****
link_to_remote "yeah" , :update =>
2010 Jul 01
6
Close Modalpopup with RJS
hi guys:
I''m scratching my head on this one: I have a twitter app where I''m
trying to open a modalpopup with a twitter sign in, get them to sign in,
then close the popup and refresh the main window. My code however
refreshes the main window with the popup window result, which I thought
was really strange:
application.html.erb
function OpenModalPopUP()
{
2006 Feb 14
4
Escaping the AJAX View
I have a login form, in which I use a "form_remote_tag".
I''m redirecting users to this form when they fail authentication as well...
and using the "jumpto" method of capturing they
original URL they requested via request.parameters, and redirecting to this
URL after they authenticate.
Problem is, if I try to do a "redirect_to", this won''t work, as
2006 Jul 22
4
Visible elements in RJS
How can I know if a an element is visible or hidden in RJS
I''m trying to hide/show some data but it does not work
Error => parse error, unexpected $undefined.
#show_doctor.rjs
if($("#{@element}").visible())
page.hide "hide_#{@element}"
end
Any ideas?
@element contains the value of the html element
--
Posted via http://www.ruby-forum.com/.
2010 May 03
7
rendering images dynamically
Hi,
I have a rails application where I respond to a request by fetching
image urls from various web api calls and need to display them as they
come available. I am able to display all the images once I get them
all, but that causes an unacceptable delay for my user.
One approach I am trying is, from my controller, set an @image
variable, and then pass in a block to the model that retrieves the
2011 Dec 16
3
PROBLEN IN AJAX USING RJS
I am using rails 3. I have problem in out put so please tell me my
mistake
routes
-------
entermatch ''/view_article/:user_id/:article_id'' =>
''articles#view_article'', :as => :view_article
resources :users do
resources :articles do
resources :comments
end
end
article controller
------------------
def view_article
@user =
2006 Jun 23
4
Ajax.Request with page reload?
I need to send a POST request via a link, along with paramater data for
an action, and the page needs to reload. link_to_remote worked great
when I was updating a DOM element but obviously won''t work when I need
to reload a page. Is there an option
--
Posted via http://www.ruby-forum.com/.
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}"
2008 Apr 07
5
trying to use Ajax.InPlaceEditor
Hi,
I''m programming a Ruby on Rails project where I am on the edit page
of /boxes/1/edit and I''m trying to make an InPlaceEditor for the color
property. (E.g. red box, blue box, etc.) My problem is that after
successfully saving the value in the database, the response I get from
the server is javascript, and it''s being rendered in the place where
the updated value is
2006 Feb 08
5
RJS
I am playing with the new .rjs stuff in edge rails.
I am doing stuff like :
page.replace_html ''scoops_tot'', @scoops.size
1. I want to add my own javascript functions to the page object.
Is it possible and how ?
2. I am trying to update several fields, but i would like a to have a
dekay between the updates :
@anoclicks.each{|aclick|
page.replace_html
2006 Jan 16
1
redirect_to is not working with ajax forms
I''m having trouble using redirect_to in an action called by a
remote_form_tag.
The log shows the redirect, and rendering of the redirected page, but the
browser
won''t redirect. If I set :update in the form_remote_tag, the page that was
supposed
to be redirected to will replace the :update elements content, and crash
FF1.5
Running edge rails, and utf8 encoding
joshua
2006 Mar 27
13
Is this a bug in Ajax handling?
When a controller responds to a link_to_remote with a redirect_to, the
link_to_remote gets a success callback, this would seem like a bug to
me, at a minimum it should return a failure?
This is driving me crazy because all the login engines/generators
respond to an authentication error with a redirect_to. The work around
is to change them to all do a
render :layout => false, :status => 500
2006 Feb 22
3
how to escape from AJAX URL
This may be a bit difficult to explain, but here goes.
I''m developing a web site which has a nice AJAX part to it (thanks to
rails). You just click on the link and it take you to the ajax part
which is on a seperate page.
-The user then selects directories or files from via a multiple menu.
-When the user selects a directory (and hits the submit button) the menu
is updated with the