#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    174
    Rep Power
    12

    Form_remote_tag not displaying button


    Hello - I'm trying to use a form_remote_tag to make a submit button to fire off an Ajax call. When I add this form_remote_tag code I don't see a submit button where there should be one.

    I'm following the example given in the Agile Web Development book starting on page 122.

    The code I'm using as follows

    Code:
    <% form_remote_tag :url => { :action => :add_to_cart, :id => product } do %>
    <%= submit_tag "Add to Cart" %>
    <% end %>
    I also have enabled the javascript_include_tag :defaults like this

    Code:
    <%= javascript_include_tag :defaults %>
    Any ideas why the button wouldn't show up?

    Thanks,
    Clem
    Edit/Delete Message
    Last edited by CLEM_C_ROCK; December 20th, 2006 at 04:10 AM.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    174
    Rep Power
    12
    Ok Problem solved - it must be just the version of rails I was running:

    this the the version that worked for me:

    Code:
    <%= form_remote_tag :url => { :action => :add_to_cart, :id => product } 
    %>
      <%= submit_tag "Add to Cart" %>
    <%= end_form_tag %>
    Originally Posted by CLEM_C_ROCK
    Hello - I'm trying to use a form_remote_tag to make a submit button to fire off an Ajax call. When I add this form_remote_tag code I don't see a submit button where there should be one.

    I'm following the example given in the Agile Web Development book starting on page 122.

    The code I'm using as follows

    Code:
    <% form_remote_tag :url => { :action => :add_to_cart, :id => product } do %>
    <%= submit_tag "Add to Cart" %>
    <% end %>
    I also have enabled the javascript_include_tag :defaults like this

    Code:
    <%= javascript_include_tag :defaults %>
    Any ideas why the button wouldn't show up?

    Thanks,
    Clem
    Edit/Delete Message
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    174
    Rep Power
    12
    Ok Problem solved - it must be just the version of rails I was running:

    this the the version that worked for me:

    Code:
    <%= form_remote_tag :url => { :action => :add_to_cart, :id => product } 
    %>
      <%= submit_tag "Add to Cart" %>
    <%= end_form_tag %>

IMN logo majestic logo threadwatch logo seochat tools logo