Displaying 20 results from an estimated 6000 matches similar to: "RJS and Form Validation (Best Practice)"
2006 Jan 27
17
Multiple Model Validation
Hey All !
I have a form which contains two models. I would like both models to be
validated, but have their validations aggregated on the page.
If I do:
<%= error_messages_for(:model1) %>
<%= error_messages_for(:model2) %>
It puts two big validation blocks on the page. I would like all the errors
from both models, but only in one validation box.
Is this possible ? All my attempts
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 Jan 14
14
Javascript/AJAX Debugging
Hello !
I''m trying to implement something similar to the "multiple updates" section
of the Web2.0 chapter of the Agile book.
I implemented my version, and nothing is happening. No javascript errors,
my logs look fine, page is rendered fine... just no Effect.Highlight. Here
is the code:
views/causes/cause_home/index.rhtml
===============
<%= form_remote_tag(:complete =>
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 Jan 12
5
Ajax: Multiple Element Update
I''m trying to apply an Effect.Highlight only to elements of a Form that was
submitted.
So if a user updated 2 fields of a 10 field form, the Effect.Highlight would
be applied to the 2 fields... showing the user what was updated.
My first attempt was to use the :complete=>"eval(request.responseText)" ...
however, the template that get''s rendered won''t know
2006 Feb 01
6
Little Ferret Problem
I''ve implemented Ferret, using the instructions here:
http://wiki.rubyonrails.com/rails/pages/HowToIntegrateFerretWithRails
I get no errors in the application at all... however, I always get 0
results.
I built an index off of some data, it exists in the index/ directory, the
form submits find... etc...
Just 0 results... all the time :)
I confirmed the data from my models is being put
2006 Jan 30
10
form_remote_tag and redirects
I would like to have a login box setup so that if incorrect info is
submitted, the box "shakes" via Effect.Shake.
If the correct information is submitted, I want to redirect to some other
page.
The only solution I''ve found is the following, which is pretty ugly, as it
displays the javascript I''m invoking on the page prior to the redirect.
Here is the code:
The Form
2006 Feb 24
5
Sanity Check
Maaaaaaaaaaaaajor sanity check needed.
I wrote a simple little plugin, and it wouldn''t load. I put some comments
in it''s init.rb, and it didn''t even spit those out. So, I dug into the
initializer.rb (/vendor/rails/railties/lib/initializer.rb) to see wtf is
going on, and found the problem... but... can''t explain it. Here is the
code in question:
2006 Jan 19
1
Model Validation & Floating Attributes
Hello all !
I have a model being validated that spits it''s error messages on the
resulting page using:
error_messages_for(:mymodel) .... Basic stuff. It''s working perfectly.
Now, I have something else I want to check on the same page (that isn''t an
attribute to the Model)... and am trying to add it using:
@mymodel.errors.add_to_base("another error here")
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
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 31
8
New Rails site... RightCart.com
Hello Everyone !
Wanted to announce the launch of a new, 100%, Ruby/Rails based shopping
system.
http://www.rightcart.com (our blog: http://www.rightcartblog.com)
It''s basically a shopping widget that allows users to make purchases
directly through the widget.... no need to be redirected to a third party
shopping cart.
You can sell anything you want by upload the products onto the
2006 Jul 16
6
How to access element attributes using RJS?
For example, in the following block:
page.select(''.foo'').each do |element|
...
end
How would I access, just for example, the id attribute of each element in
the collection?
I''ve randomly tried element.id and element.attributes[''id''], but neither of
those has worked. I''ve also been unsuccessful in finding any documentation
on this, but it
2006 Feb 22
15
Fixtures and Relationships
In my daily development, I migrate back and forth between versions, and
often do: rake load_fixtures...
... in order to populate my development database with fun data.
Now, with any HABTM relationship, there are failures, as there is no way to
say "which" fixtures to load first.
Within an actual functional or unit test case, you could simply load them in
the proper order, but
2006 Jul 08
1
Ajax, RJS, and Standard Form Errors
Hi all,
I''m trying to take the standard scaffold and add a bit for ajax to it. I
have a two column page with the list on the left and the right side is
reserved for the create/edit actions. On a successful save my rjs executes
and updates the list view on the left and returns the right side to a "home"
page. However, if one of the model validations fail I use rjs ro
2006 Jan 15
5
ActiveRecordCache
I believe I heard some talk of an ActiveRecordCache being developed while I
was on IRC... however, can''t find the actual project.
Anybody know if this is being developed, or where I can find more
information on it ?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060115/b47317b2/attachment.html
2006 Jan 13
3
The Vendor Directory
I''m working with a Development and a Production environment
In order to keep things in synch between the two environments, I thought it
would be good to "gem unpack" all of my currently installed gems into
the vendor/ directory... so when I push things into Production... everything
jives.
I unpacked about 20 gems into the vendor/ directory.... now everything is
broke :)
I
2006 Feb 06
4
Relationship Question (STI)
My girlfriend and I have been dating for two years, and she just told me she
has an STI...
Actually, I currently have three different models, like: Dog, Whale, Monkey
They all have some similar attributes, but, they are unique enough to
break into their own models. I could use STI, but I think the table would
just have too many columns.
Now, I wanted to let the Dog''s, Whale''s
2006 Feb 28
12
Examples for Money library ?
Can anybody share some examples of their Money implementation ?
I''m trying to setup a Model to use this library, but can''t seem to wrap my
head around how it is exactly supposed to work.
My Model (Foo) looks like:
===============
composed_of :commission, :class_name => "Money", :mapping => [
%w(commission_cents cents), %w(commission_currency currency) ]
Yet, in
2006 Jul 21
1
RJS Failing
This code was working before I created the update_link_list method in
the helper below (everything was in the controller). I can successfully
create a new link but I get a TypeError when I leave all form fields
blank -- I expect to see validation error messages.
---
#link_controller.rb:
def create
link = Link.new(params[:link])
saved = link.save
num_links = Link.find(:all).size