Forum: Ruby on Rails Ajax Scaffold Generator for Rails Released

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.
8c6f7a9319edb23cd79440d7202d8668?d=identicon&s=25 Richard White (Guest)
on 2006-02-25 22:38
(Received via mailing list)
I just released a whole new version of the Ajax Scaffold Generator (for
Ruby
on Rails). The generator creates a scaffold page like the typical rails
one,
except adding, editing and deleting are all done inline. The generated
scaffold is valid XHTML strict and fully styled right out of the box.

Check out the demo:

http://ajaxscaffold.height1percent.com/
And the how-to:

http://www.height1percent.com/articles/2006/02/21/...

Its a generates a much better starting point for an Ajax'ified
application
or for any application than the existing scaffold generator. I hope you
guys
find it useful.
Thanks.

--
Richard White
Interface Designer
Blog | www.height1percent.com
Easy to use online calendar | www.kiko.com
Keep in touch with relatives | www.youlookfamiliar.com
C1e5a9e9344b6d31b9df7303e6dc378a?d=identicon&s=25 Craig White (Guest)
on 2006-02-25 23:02
(Received via mailing list)
On Sat, 2006-02-25 at 16:36 -0500, Richard White wrote:
> And the how-to:
>
> http://www.height1percent.com/articles/2006/02/21/...
>
>
> Its a generates a much better starting point for an Ajax'ified
> application or for any application than the existing scaffold
> generator. I hope you guys find it useful.
----
looks impressive and I suspect that I will be playing with it soon. Nice
demo and description too.

Thanks

Craig
Bb6ecee0238ef2461bef3416722b35c5?d=identicon&s=25 pat eyler (Guest)
on 2006-02-25 23:11
(Received via mailing list)
On 2/25/06, Craig White <craigwhite@azapple.com> wrote:
> >
> demo and description too.
It does look good.   Good enough that I posted a message about it at
the Apress blog -- http://ablog.apress.com/?p=938

I can't wait to see how this fits in with a small app I'm doing at work.

>
> Thanks
>
> Craig
>
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>


--
thanks,
-pate
8e44c65ac5b896da534ef2440121c953?d=identicon&s=25 Ezra Zygmuntowicz (Guest)
on 2006-02-25 23:54
(Received via mailing list)
Very cool!

-Ezra
2073c7e0e7d2311727b680a887a375be?d=identicon&s=25 Leon Leslie (Guest)
on 2006-02-26 00:27
(Received via mailing list)
kool... but paging support would be excellent!
75ba8cc30aed7b9df578d98ebdcf8491?d=identicon&s=25 Brian (Guest)
on 2006-02-26 01:58
I downloaded this last night, and regenerated scaffolds for about half a
dozen models on one of my projects.  It is simply amazing.  I had no
hiccups, and it looks and works perfectly on every browser I threw at
it.  thanks for your hard work on this Richard.  (and unlike my earlier
email to Zed, I made sure to get your  name right).

Brian
685df76ebeb6c0d61ff5e0284830f691?d=identicon&s=25 Jim Cheetham (Guest)
on 2006-02-26 03:33
(Received via mailing list)
On Sun, Feb 26, 2006 at 01:58:49AM +0100, Brian wrote:
> hiccups, and it looks and works perfectly on every browser I threw at
> it.


Well, I threw Opera 9 p2 (3216) under OSX at it, and when creating a
customer record received a JavaScript popup box "TableRow: both
parameters must be a <tr> tag."

It worked fine with Safari, and Firefox.

But, despite that - very nice :-)

-jim
0e1f913bd7b6e69419fe88c82c9a15ed?d=identicon&s=25 Sean Stephens (Guest)
on 2006-02-26 03:42
(Received via mailing list)
Jim Cheetham wrote:
>
> It worked fine with Safari, and Firefox.
>
> But, despite that - very nice :-)
>
> -jim
>
I got that same error also when trying the demo running Safari under
Tiger (intel).  However, I think it's something with the demo?  It was
random for me and seemed to only happen after a canceled Edit of a row.
After reloading the data I was able to edit again.

-Sean
B8eac48284371e2e0c4c32145933f9d0?d=identicon&s=25 David Olbersen (Guest)
on 2006-02-26 07:51
(Received via mailing list)
On Feb 25, 2006, at 1:36 PM, Richard White wrote:

>
> http://www.height1percent.com/articles/2006/02/21/...
> scaffold-generator
> Its a generates a much better starting point for an Ajax'ified
> application or for any application than the existing scaffold
> generator. I hope you guys find it useful.
Ya know, I just spent the past two days teaching myself RoR from
scratch. I'd gotten about 3/4 of the functionality you have (with
none of the style) and this comes out. Thanks a ton! Now I can get
back to doing the application work, and stop dorking around with the
interface so much!

RoR just went from RAD to k-RAD. Thanks a ton!
8c6f7a9319edb23cd79440d7202d8668?d=identicon&s=25 Richard White (Guest)
on 2006-02-27 02:57
David Olbersen wrote:
> On Feb 25, 2006, at 1:36 PM, Richard White wrote:
>
>>
>> http://www.height1percent.com/articles/2006/02/21/...
>> scaffold-generator
>> Its a generates a much better starting point for an Ajax'ified
>> application or for any application than the existing scaffold
>> generator. I hope you guys find it useful.
> Ya know, I just spent the past two days teaching myself RoR from
> scratch. I'd gotten about 3/4 of the functionality you have (with
> none of the style) and this comes out. Thanks a ton! Now I can get
> back to doing the application work, and stop dorking around with the
> interface so much!
>
> RoR just went from RAD to k-RAD. Thanks a ton!

Thanks for the kind words everyone. If you found the scaffold at all
useful or interesting please drop by the lastest post on my blog and
opon on what you'd like to see built/fixed next. Thanks again.

http://www.height1percent.com/articles/2006/02/26/...

Rich
Fbfee2c29edaacecc28f616aa0b542f4?d=identicon&s=25 kevin (Guest)
on 2006-02-27 14:46
Leon Leslie wrote:
> kool... but paging support would be excellent!
To get pagination, I added these lines to view_list.rhtml, right after
the table.

<div align=right>
<%%= link_to '<<', { :page => @pages.current.previous } if
@pages.current.previous %>
<%%=pagination_links_each(@pages, :window_size => 4) do |n|
    "<a href='?page=#{n}'>#{n}</a>"; end %>
<%%= link_to '>>', { :page => @pages.current.next } if
@pages.current.next %>
</div>

AND replaced the first 20 lines in controller.rb

class <%= controller_class_name %>Controller < ApplicationController

<% unless suffix -%>
  def index
    list
    render_action 'list'
  end
<% end -%>


<% for action in unscaffolded_actions -%>
  def <%= action %><%= suffix %>
  end
<% end -%>

  def list<%= suffix %>
    #@<%= plural_name %> = <%= model_name %>.find :all
    #render :layout => false
	@pages, @<%= plural_name %>  = paginate :<%= plural_name %> , :per_page
=> 10
  end
8c6f7a9319edb23cd79440d7202d8668?d=identicon&s=25 Richard White (Guest)
on 2006-02-27 16:13
kevin wrote:
> Leon Leslie wrote:
>> kool... but paging support would be excellent!
> To get pagination, I added these lines to view_list.rhtml, right after
> the table.
>
> <div align=right>
> <%%= link_to '<<', { :page => @pages.current.previous } if
> @pages.current.previous %>
> <%%=pagination_links_each(@pages, :window_size => 4) do |n|
>     "<a href='?page=#{n}'>#{n}</a>"; end %>
> <%%= link_to '>>', { :page => @pages.current.next } if
> @pages.current.next %>
> </div>
>
> AND replaced the first 20 lines in controller.rb
>
> class <%= controller_class_name %>Controller < ApplicationController
>
> <% unless suffix -%>
>   def index
>     list
>     render_action 'list'
>   end
> <% end -%>
>
>
> <% for action in unscaffolded_actions -%>
>   def <%= action %><%= suffix %>
>   end
> <% end -%>
>
>   def list<%= suffix %>
>     #@<%= plural_name %> = <%= model_name %>.find :all
>     #render :layout => false
> 	@pages, @<%= plural_name %>  = paginate :<%= plural_name %> , :per_page
> => 10
>   end

Yep, you could do that if you really need pagination at this point. A
better solution would involve one where pagination would work more
client side. For example if you deleted 3 rows on the table it should
pull up 3 from the next page instead of just having a shrinking page and
inconsistent data when you go to the next.

We'll support that eventually, and sooner than later.

Rich
32ba8c5c148da2653028dc7f8066b810?d=identicon&s=25 Doug Bromley (ashiro)
on 2006-02-27 16:59
(Received via mailing list)
This is superb.  Thank you so much for your contribution!!

One point though - I may be missing something obvious but when I create
the
following scaffold using a module:

ruby script/generate scaffold ajax_scaffold Tariff 'admin/tariffs'

When clicking to 'Create New' it has a routing error stating it can't
find:
admin/admin/tariff/new

I go into the code and find all the links and controllers are relative
"admin/tariff" I can solve the issue by one of two ways:
1) Add a forward slash before admin "/admin/tariff"
2) remove the "admin/" so the relative path is correct.

Not a worry as I have it working but just thoguht I'd let you know.

All the best - Keep up the good work!!

Doug
40db9e75b3f5899258e3bdc0c9210154?d=identicon&s=25 Conrad Taylor (Guest)
on 2006-02-28 20:02
(Received via mailing list)
Hi, coudl someone tell me what to down load and how to install it?

Thanks in advance,

-Conrad
Aad37b5f7116c8d1f547d23b37566032?d=identicon&s=25 Greg Donald (destiney)
on 2006-02-28 20:26
(Received via mailing list)
On 2/28/06, Conrad Taylor <conradwt@gmail.com> wrote:
> Hi, coudl someone tell me what to down load and how to install it?

It's right there on the page:

Look for "Getting Started"

http://www.height1percent.com/articles/2006/02/21/...





--
Greg Donald
Zend Certified Engineer
MySQL Core Certification
http://destiney.com/
40db9e75b3f5899258e3bdc0c9210154?d=identicon&s=25 Conrad Taylor (Guest)
on 2006-02-28 20:36
(Received via mailing list)
Hi, when I go to the download area, I'm presented with three files for
the 2.1.0 release. Two of the files are compressed archives and one of
them is a .gem file.  It's simply not clear as to what to download and
it seem that some steps were skipped to me.

-Conrad
171ea139761951336b844e708d1547ab?d=identicon&s=25 James Byrne (byrnejb)
on 2006-02-28 21:18
Conrad Taylor wrote:
> Hi, when I go to the download area, I'm presented with three files for
> the 2.1.0 release. Two of the files are compressed archives and one of
> them is a .gem file.  It's simply not clear as to what to download and
> it seem that some steps were skipped to me.
>
> -Conrad

The easiset thing to do is to first install gem, which effectively is
Ruby's package manager.  Get gem from rubyforge :

http://rubyforge.org/frs/?group_id=126&release_id=2471

and unpack it into a working directory.

From the package directions:

If you don't have any gems install, there is still the pre-gem
approach to getting software ... doing it manually:

1. DOWNLOAD FROM: http://rubyforge.org/frs/?group_id=126
2. UNPACK INTO A DIRECTORY AND CD THERE
3. INSTALL WITH:  ruby setup.rb all  (you may need admin/root privilege)

Now you can do things like:

# gem install ajax_scaffold_generator --remote

and everything needed for ajax_scaffold_generator will be identified and
downloaded for you (after you consent).

Installing gem now will make extending and maintaining ruby and rails
much easier for you later.

Regards,
Jim
912436ffe7c27e25658a3f5f556a8c96?d=identicon&s=25 Adam Fields (Guest)
on 2006-02-28 21:31
(Received via mailing list)
On Tue, Feb 28, 2006 at 09:18:44PM +0100, James Byrne wrote:
[...]
> # gem install ajax_scaffold_generator --remote
>
> and everything needed for ajax_scaffold_generator will be identified and
> downloaded for you (after you consent).
>
> Installing gem now will make extending and maintaining ruby and rails
> much easier for you later.

It occurs to me after using a bunch of these - why are the rails gems
not labeled as such?

There are lots of gems, and many of them are generic ruby
packages. Perhaps we could encourage people who make gems for rails to
specify that they're rails-specific in the names.

It would be much clearer if this was rails_ajax_scaffold_generator.


--
				- Adam

** Expert Technical Project and Business Management
**** System Performance Analysis and Architecture
****** [ http://www.everylastounce.com ]

[ http://www.aquick.org/blog ] ............ Blog
[ http://www.adamfields.com/resume.html ].. Experience
[ http://www.flickr.com/photos/fields ] ... Photos
[ http://www.aquicki.com/wiki ].............Wiki
[ http://del.icio.us/fields ] ............. Links
38a8230ed3d5c685558b4f0aad3fc74b?d=identicon&s=25 Joe Van Dyk (Guest)
on 2006-02-28 22:04
(Received via mailing list)
On 2/26/06, Richard White <rrwhite@gmail.com> wrote:
> > scratch. I'd gotten about 3/4 of the functionality you have (with
> http://www.height1percent.com/articles/2006/02/26/...
>

How could I modify this to do file uploads?  I can't do uploads inside
form_remote_tag, right?
8c6f7a9319edb23cd79440d7202d8668?d=identicon&s=25 Richard White (Guest)
on 2006-03-01 04:40
Doug: Thanks for pointing that out. Honestly, I hadn't done much with
the original scaffold generator outside of having a different controller
name than the model name. I will add this into my test scenarios and
hopefully release a minor point release to cover this issue. Thanks
again for bringing it to my attention.

Doug Bromley wrote:
> This is superb.  Thank you so much for your contribution!!
>
> One point though - I may be missing something obvious but when I create
> the
> following scaffold using a module:
>
> ruby script/generate scaffold ajax_scaffold Tariff 'admin/tariffs'
>
> When clicking to 'Create New' it has a routing error stating it can't
> find:
> admin/admin/tariff/new
>
> I go into the code and find all the links and controllers are relative
> "admin/tariff" I can solve the issue by one of two ways:
> 1) Add a forward slash before admin "/admin/tariff"
> 2) remove the "admin/" so the relative path is correct.
>
> Not a worry as I have it working but just thoguht I'd let you know.
>
> All the best - Keep up the good work!!
>
> Doug
8c6f7a9319edb23cd79440d7202d8668?d=identicon&s=25 Richard White (Guest)
on 2006-03-01 04:41
Or even 'ajax_scaffold_rails_generator' .. but nevertheless you make a
very valid point. I wish I had thought of that before I created all the
packages (I know I could go back and change them, but I don't really
wanna deal with the confusion that would cause).

Adam Fields wrote:
> On Tue, Feb 28, 2006 at 09:18:44PM +0100, James Byrne wrote:
> [...]
>> # gem install ajax_scaffold_generator --remote
>>
>> and everything needed for ajax_scaffold_generator will be identified and
>> downloaded for you (after you consent).
>>
>> Installing gem now will make extending and maintaining ruby and rails
>> much easier for you later.
>
> It occurs to me after using a bunch of these - why are the rails gems
> not labeled as such?
>
> There are lots of gems, and many of them are generic ruby
> packages. Perhaps we could encourage people who make gems for rails to
> specify that they're rails-specific in the names.
>
> It would be much clearer if this was rails_ajax_scaffold_generator.
>
>
> --
> 				- Adam
>
> ** Expert Technical Project and Business Management
> **** System Performance Analysis and Architecture
> ****** [ http://www.everylastounce.com ]
>
> [ http://www.aquick.org/blog ] ............ Blog
> [ http://www.adamfields.com/resume.html ].. Experience
> [ http://www.flickr.com/photos/fields ] ... Photos
> [ http://www.aquicki.com/wiki ].............Wiki
> [ http://del.icio.us/fields ] ............. Links
8c6f7a9319edb23cd79440d7202d8668?d=identicon&s=25 Richard White (Guest)
on 2006-03-01 04:46
I'm not honestly sure about whether file uploads work inside a
form_remote_tag. If they don't then obviously an ajax scaffold won't
help you one bit.

If you can then you should be able to create a simple file manager
easily with by creating a basic scaffold (maybe of an UploadFile model
that has a label attribute), modifying the form to add a file upload box
and creating the necessary controller code to handle form submission of
said file upload.

Joe Van Dyk wrote:
> On 2/26/06, Richard White <rrwhite@gmail.com> wrote:
>> > scratch. I'd gotten about 3/4 of the functionality you have (with
>> http://www.height1percent.com/articles/2006/02/26/...
>>
>
> How could I modify this to do file uploads?  I can't do uploads inside
> form_remote_tag, right?
410818a4436e5eb404d82513cd2344a7?d=identicon&s=25 Jeff McDonald (Guest)
on 2006-03-01 09:15
(Received via mailing list)
Yep, JavaScript doesn't have access to the filesystem (unless you're
Microsoft).  So form_remote_tag will not work for file uploads.

-- Jeff

(here's one reason why)
http://www.symantec.com/avcenter/venc/data/js.gigg...
30269682335f1fb247d71969fa715b5e?d=identicon&s=25 Roberto Saccon (rsaccon)
on 2006-03-01 16:54
(Received via mailing list)
well, with Kyle's plugin ( http://www.kylemaxwell.com/ ) you CAN upload
files from form_remote_tag. Check out the sample app and the comments
for
how to make it work on rails edge
616226cee3466e91febcd38f75c69194?d=identicon&s=25 Helmut Sedding (Guest)
on 2006-03-01 17:03
(Received via mailing list)
Hi Richard,

please keep an eye on cross-browser-compatibility.

What is with non-javascript-browsers like dillo or links? Do you
provide alternative ways for a use case?

Does it work with upcoming browsers that are not yet released or even
thought of?

regards,
Helmut

Am 25.02.2006 um 22:36 schrieb Richard White:
8c6f7a9319edb23cd79440d7202d8668?d=identicon&s=25 Richard White (Guest)
on 2006-03-01 21:46
It only supports and probably only will support FF 1.0+, Safari 10.4+
and IE 6+. I have a post on my site about future direction and I
specifically state that I will *NOT* spend my time making it work for
the ~1% of people that don't have one of those browsers I just listed.

Same goes for anyone without JS. I mentioned this on that same blog post
that I am not interested in devoting a large amount of time to people
stuck in the stone age with Javascript. They make up a very small % of
the population and I'm not that concerned with them. If you are building
an Ajax application and your core set of users don't have JS then you
are doing something wrong.

As far as 'upcoming browsers that are not yet released or even thought
of' I'm not sure if that's a joke or if you are using that as a segway
to sell me a crystal ball :) But no, I won't guarantee that I can
support indeterminate things in the future hehe.

Rich


Helmut Sedding wrote:
> Hi Richard,
>
> please keep an eye on cross-browser-compatibility.
>
> What is with non-javascript-browsers like dillo or links? Do you
> provide alternative ways for a use case?
>
> Does it work with upcoming browsers that are not yet released or even
> thought of?
>
> regards,
> Helmut
>
> Am 25.02.2006 um 22:36 schrieb Richard White:
40db9e75b3f5899258e3bdc0c9210154?d=identicon&s=25 Conrad Taylor (Guest)
on 2006-03-04 08:52
(Received via mailing list)
Hi Richard, when I one clicks the "create new", it creates a form for
taking user inputs.  However, shouldn't one only be able to create a
single form?  For example, when I click create, it can generate one
form right after the previous on the same page.  I'm guessing that it
should only be one form presented and the form should be presented
only when it's not visible.

-Conrad
8c6f7a9319edb23cd79440d7202d8668?d=identicon&s=25 Richard White (Guest)
on 2006-03-05 00:18
Conrad Taylor wrote:
> Hi Richard, when I one clicks the "create new", it creates a form for
> taking user inputs.  However, shouldn't one only be able to create a
> single form?  For example, when I click create, it can generate one
> form right after the previous on the same page.  I'm guessing that it
> should only be one form presented and the form should be presented
> only when it's not visible.
>
> -Conrad

Why limit it? I don't see any reason to restrict the user to only have
one create form open at once. If you know of a reason that I haven't
thought of let me know.

-Rich
Eea7ad39737b0dbf3de38874e0a6c7d8?d=identicon&s=25 Justin Forder (Guest)
on 2006-03-05 02:17
(Received via mailing list)
Richard White wrote:

> are doing something wrong.
The most important consideration here is that disabled people (who may
rely on assistive technologies like screen readers) may not be able to
use a site which depends on JavaScript and DHTML. It's fine to give a
better user experience to people who can see well and use a mouse, but
it's not fine (and may be illegal) to prevent less fortunate people from
using a web site or application.

   Justin
8c6f7a9319edb23cd79440d7202d8668?d=identicon&s=25 Richard White (Guest)
on 2006-03-05 02:31
Justin Forder wrote:
> Richard White wrote:
>
>> are doing something wrong.
> The most important consideration here is that disabled people (who may
> rely on assistive technologies like screen readers) may not be able to
> use a site which depends on JavaScript and DHTML. It's fine to give a
> better user experience to people who can see well and use a mouse, but
> it's not fine (and may be illegal) to prevent less fortunate people from
> using a web site or application.
>
>    Justin

Justin, I laugh at the idea but you do put a more human face on the
problem. I apologize for being so crass in my comments.

Thankfully thats all water under the bridge now, as the 2.2.0 release
gracefully degrades in the abscence of Javascript.

Rich
Eea7ad39737b0dbf3de38874e0a6c7d8?d=identicon&s=25 Justin Forder (Guest)
on 2006-03-05 03:48
(Received via mailing list)
Richard White wrote:
>>
>>    Justin
>
> Justin, I laugh at the idea but you do put a more human face on the
> problem. I apologize for being so crass in my comments.
>
> Thankfully thats all water under the bridge now, as the 2.2.0 release
> gracefully degrades in the abscence of Javascript.

Well done! I appreciate that scaffold is only to get people started, but
it's also a way of teaching by example...

I was impressed by the demo of your first version, and will take another
look.

   Justin
Ff9ba6ea540d0d42d520a33107c3ac31?d=identicon&s=25 Erik B. Ordway (Guest)
on 2006-03-29 21:59
(Received via mailing list)
I love the Ajax scaffold generator for machine administrative
consoles.  I do have a suggestion though.


A suggestion for the generator.  With some hacking it is possible to
support putting one thing in a sub list of the list for an other
thing.  Say that you have a display for a set of vending machines and
for each vending maching there are n different things sold so the
list display for vending machines might look like:

Vending machines----------------------------Create vending machine
Vending machine #1                               Edit , Delete
       Sales Items------------------------------------Create new
sales item
        Item #1                 400 in stock         Edit , Delete
        Item #2                 12 in stock            Edit , Delete
        ......
Vending machine #2                               Edit , Delete
       Sales Items------------------------------------Create new
sales item
        Item #1                 53 in stock         Edit , Delete
        Item #4                 370 in stock        Edit , Delete
        ......

If the type of Vending machine = vender and Sales items = item the
change need to do this is to modify the value used by the javascript
in 'ajax_scaffold.js' to find the right DOM elements.  What I did was
add an '_#{vender_id} to each place an id was being set or
'link_to_remote was being set.  This modified the value used as
'type' in 'ajax_scaffold.js' .  Also the 'list.rhtml' for item was
turned in to a partial '_list.rhtml'  so that it could be called from
the '_vendor.rhtml' partial

To make this easier it would be great if the *.rhtml templates took a
value set (:parent_id for example) in :locals of the call to the
partial that insert a value to all the css id names and
call_to_remote calls  to do what I did manually to each place the
'type' value was set.  This could look like the following

What is now
	<h2>Sales Items</h2>
<div class="actions">
	<%= loading_indicator_tag 'item', "new" %>
	<%= link_to_remote "Create New",
         { :url => { :controller => 'items', :action => 'new'  },
         	:loading => "AjaxScaffold.newOnLoading(request,'items');",
		:success => "AjaxScaffold.newOnSuccess(request,'items');",
		:failure => "AjaxScaffold.newOnFailure(request,'items');" },
         { :href => url_for(:controller => 'items', :action => 'new'  ),
		:class => "create" } %>


What I did
	<h2>Sales Items</h2>
<div class="actions">
	<%= loading_indicator_tag 'item_'+vender_id.to_s, "new" %>
	<%= link_to_remote "Create New",
         { :url => { :controller => 'items', :action =>
'new' , :vender_id=>vender_id },
         	:loading => "AjaxScaffold.newOnLoading(request,'items_#
{vender_id.to_s}');",
		:success => "AjaxScaffold.newOnSuccess(request,'items_#
{vender_id.to_s}');",
		:failure => "AjaxScaffold.newOnFailure(request,'items_#
{vender_id.to_s}');" },
         { :href => url_for(:controller => 'items', :action =>
'new' , : vender_id => vender_id ),
		:class => "create" } %>

WHAT COULD BE

	<h2>Sales Items</h2>
<div class="actions">
	<%= loading_indicator_tag 'item_'+parent_id, "new" %>
	<%= link_to_remote "Create New",
         { :url => { :controller => 'items', :action =>
'new' , :parent_id=>parent_id },
         	:loading => "AjaxScaffold.newOnLoading(request,'items_#
{parent_id}');",
		:success => "AjaxScaffold.newOnSuccess(request,'items_#
{parent_id}');",
		:failure => "AjaxScaffold.newOnFailure(request,'items_#
{parent_id}');" },
         { :href => url_for(:controller => 'items', :action =>
'new' , :parent_id => parent_id ),
		:class => "create" } %>
This topic is locked and can not be replied to.