Forum: Ruby on Rails link_to_remote (AJAX) and tables: IE issues, validation?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Henrik N (Guest)
on 2006-02-12 16:01
I have a table that lists domain names, with a form next to it to add
new domains.

I have AJAXified this so that new domains are immediately added as table
rows. This works fine in Firefox 1.5/Win, but not in IE6/Win. Domains
are added into the database, but the HTML table is not updated unless
you reload the page.

Some googling tells me there are issues with e.g. link_to_remote
updating tables in IE (I tried updating a div and that worked fine), so
I'm simply asking if anyone knows of a decent solution, other than going
non-AJAX, dropping IE support or using something other than a table.

Also, has anyone written code to get validations with link_to_remote? So
if someone attempts to add a non-valid domain, you would get some sort
of readable error message.

Some of my code:

View:

<%= form_remote_tag(
 :url => { :action => 'create' },
 :update =>  "items",
 :position => :bottom,
 :complete => 'focus_field()') %>

Controller:

  def create
    @domain = Domain.new(params[:domain])
    if @domain.save
      render(:partial => 'domain', :object => @domain, :layout => false)
    else
      #FIXME: No decent error handling yet - try adding duplicate
domains
      render :action => 'new'
    end
  end

where "items" is a table and the domain partial a table row.
BigSmoke (Guest)
on 2006-04-04 17:11
(Received via mailing list)
On 2/12/06, Henrik N <removed_email_address@domain.invalid> wrote:

> Also, has anyone written code to get validations with link_to_remote? So
> if someone attempts to add a non-valid domain, you would get some sort
> of readable error message.


I've written an article on this subject, which you can find at
http://www.bigsmoke.us/ajax-validations-in-rails

Please let me know if you find anything uncomplete, unclear or missing,

  - Rowan
Neha C. (Guest)
on 2008-05-30 00:48
BigSmoke wrote:
> On 2/12/06, Henrik N <removed_email_address@domain.invalid> wrote:
>
>> Also, has anyone written code to get validations with link_to_remote? So
>> if someone attempts to add a non-valid domain, you would get some sort
>> of readable error message.
>
>
> I've written an article on this subject, which you can find at
> http://www.bigsmoke.us/ajax-validations-in-rails
>
> Please let me know if you find anything uncomplete, unclear or missing,
>
>   - Rowan

Hi,

I need help in this matter but that link doesnt seem to be working.
Can u help me.

Neha
This topic is locked and can not be replied to.