Displaying 20 results from an estimated 4000 matches similar to: "trouble with remote_form_for & html_update"
2009 Mar 15
1
remote_form_for ajax validation
Hi,
I have been reading a lot about this, but I do not manage to do a nice
validation. I already managed to save data to the database, to
validate a field, to display a "Everything went well" message. I can
also display an error message, but the view does not end up properly.
This is the form:
<% remote_form_for(product) do |f| %>
<%= f.error_messages %>
<p>
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
2006 Apr 18
2
make rails 1.1 code 1.0-compliant
Hello,
I''m working on a rails 1.1 app on my mac, but my web host hasn''t
upgraded from 1.0 to 1.1 yet, so the below code, which works on my
machine, doesn''t work on the web server:
# controller
def compare_fields
name = params[:person][:name]
@exists = Album.count(["name like :n", {:n => name}])
render :update do |page|
if @exists > 0
2009 Jan 18
2
InvalidAuthenticityToken error with remote_form_for
Hi All -
I have a form_for that I''m trying to convert to remote_form_for, and I
keep get this error:
ActionController::InvalidAuthenticityToken
(ActionController::InvalidAuthenticityToken):
/usr/lib/ruby/gems/1.8/gems/actionpack-2.2.2/lib/action_controller/request_forgery_protection.rb:86:in
`verify_authenticity_token''
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 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 Aug 24
11
link_to_function check javascript attribute
How could I check the value of an javascript object''s attribute?
<div id="new_item_details" style="display:none"></div>
<%= link_to_function("Show details...", nil, :id => "show_details") do
|page|
page.visual_effect(:toggle_blind, :new_item_details)
if (page[:new_item_details].style.visibility ==
2006 Jul 03
2
rjs renders string or partial but not template or action
Hi,
I have an rjs file. I only have one controller called called front. I
have views called "new_title.rhtml" and "_new_title.rhtml"
These work
page.replace_html ''title'', ''new title''
page.replace_html ''title'', :partial => ''new_title''
page.replace_html ''title'',
2006 May 25
5
Is there a way to abstract the updating of other parts of the page after an Ajax request without putting using the standard view file?
Hey all,
I''d like to abstract the process of updating different portions of the
page after an Ajax request has taken place. Rather than simply putting
the extra view logic in the standard rjs template, it seems to give
better separation if there is a split between the core view logic (ie,
inserting a row in a table), and updating any associated portions of
the page.
Is this possible? I
2006 Jul 20
6
replace_html + javascript
Hi all,
This is my first post to the list, so I hope it gets through and I
don''t do anything wrong :)
Here''s the issue I''m having...
I have an rjs that''s doing:
page.replace_html ''myid'', :partial => ''my_partial''
And in my my_partial I have:
<script type="text/javascript">
2008 Jul 01
8
redirect_to not working
Hi... I have a basic authentication system. I have a RESTful resource
called session with the following code when logging in:
def new
end
def create
user = User.authenticate(params[:username], params[:password])
respond_to do |format|
if user
session[:user_id] = user.id
flash[:notice] = "Welcome back #{user.name}!"
format.html {redirect_to
2006 Mar 18
9
RJS - not working in IE
I searched thru all the postings about RJS, and I didn''t find one person
who complained of problems specific to IE, but that''s what I''ve got.
My environment is:
Rails 1.0 + RJS Plugin
Updated Javascripts to Scriptaculous 1.5.3 (for evalScripts support)
Monkeypatched in_place_editor to support evalScripts
I have just started using RJS, and I have two .rjs templates.
2006 Apr 19
4
RJS replace_html auto-closing tags
I''m using the following RJS template to spit out a div containing a
list of projects:
page.replace_html ''results'', ''<div>''
@projects.each do |p|
page.insert_html :bottom, ''results'', p.name + "<br/>"
end
page.insert_html :bottom, ''searchresults'', ''</div>''
page.show
2007 May 11
2
spec a replace_html with a partial
I wanted to use ARTS to add RJS in a behaviour driven way to my
application, but I''m having some trouble asserting a replace_html with
a partial.
I''ve created a pastie (http://pastie.caboo.se/60694) which contains
the RJS I want to spec, the spec which I already wrote and its failure
message.
I''m currently using RSpec-0.9.2
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 May 25
2
page.replace_html
This is odd.
When I call: page.replace_html ''formdiv'', :partial => ''listing'' from an
rjs file it renders stuff like:
\n
\n
\n
test
\n
\n test , NY 12344
\n
\n
Phone: (999)999-8888
\n\t\t\n\n
\n \t\n \t\thttp:// \n \t\n
\n
\n \n"); } catch (e) { alert(''RJS error:\n\n'' + e.toString());
2006 Mar 07
12
rjs and partials
I''m trying to update a list, and having a hard time applying visual effects
to the latest element created. Here is what I''m doing.
===========================================
1) Creating an "item" via an action, then rendering the RJS template
2) RJS template looks like this:
page.insert_html :top, ''items'', :partial =>
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 Apr 07
2
Re: Re: page.replace_html "#{var_containing_id_name}", :partial
> you mean like this?
>
> def do_some_ajax_thing
> <at> element_id = "content_div"
> end
>
> do_some_ajax_thing.rjs
>
> page.replace_html <at> element_id, :partial => "edit"
>
> remember, the view templates have access to the attributes defined
> in the controller
Actually, its more like this: I have a list page. Each row
2006 Feb 06
6
.rjs template doesn''t load?
Skipped content of type multipart/alternative-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part
Url : http://wrath.rubyonrails.org/pipermail/rails/attachments/20060206/cf123b71/PGP.bin