getting started with ActiveScaffold on Rails 2.3

244 views
Skip to first unread message

Sarah Allen

unread,
Jul 1, 2009, 1:11:03 PM7/1/09
to ActiveScaffold : Ruby on Rails plugin
Just started exploring ActiveScaffold today with Rails 2.3.2. I'm not
seeing any ActiveScaffold UI... am I missing something?

Here's what I did:
> rails active_scaffold
> cd active_scaffold
> ./script/generate scaffold Task title:string notes:text complete:boolean
> rake db:migrate
> script/plugin install git://github.com/activescaffold/active_scaffold.git

edited views/layouts/tasks.html.erb, adding the javascript include and
active_scaffold_includes lines to the bottom of the head section:
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Tasks: <%= controller.action_name %></title>
<%= stylesheet_link_tag 'scaffold' %>
<%= javascript_include_tag :defaults %>
<%= active_scaffold_includes %>
</head>

then modified tasks_controller.rb adding:
active_scaffold :task

then started the server, went to http://localhost:3000/tasks and saw
nothing. The tutorial seems to imply that I would see something, but
maybe I need to configure something...

Can someone please point me in the right direction?

Thanks,
Sarah

Sarah Allen

unread,
Jul 1, 2009, 11:49:34 PM7/1/09
to actives...@googlegroups.com
The problem was that the regular scaffold was defining all of the
controller actions, so that ActiveScaffold wasn't getting a chance to
do anything... seems there are some basic concepts missing from that
intro tutorial. I'll try to write up a little more detail on what
I've learned in a blog post, but wanted to let you all know that I
found an answer to my question.

Sarah

Sergio Cambra .:: entreCables S.L. ::.

unread,
Jul 2, 2009, 3:41:08 AM7/2/09
to actives...@googlegroups.com
On Jueves, 2 de Julio de 2009 05:49:34 Sarah Allen escribió:
> The problem was that the regular scaffold was defining all of the
> controller actions, so that ActiveScaffold wasn't getting a chance to
> do anything... seems there are some basic concepts missing from that
> intro tutorial. I'll try to write up a little more detail on what
> I've learned in a blog post, but wanted to let you all know that I
> found an answer to my question.

You should add :active_scaffold => true to you routes:
map.resources :<your_model_name>, :active_scaffold => true

Also you will have to install render_component for nested scaffolds
./script/plugin install git://github.com/ewildgoose/render_component.git
--
Sergio Cambra .:: entreCables S.L. ::.
Mariana Pineda 23, 50.018 Zaragoza
T) 902 021 404 F) 976 52 98 07 E) ser...@entrecables.com

Sarah Allen

unread,
Jul 2, 2009, 9:06:08 AM7/2/09
to actives...@googlegroups.com
I wrote this blog post about what I ended up doing:
http://www.ultrasaurus.com/sarahblog/2009/07/getting-started-with-activescaffold/

What does active_scaffold => true do when added to a route?

Thanks for the help,
Sarah

On Jul 2, 2009, at 12:41 AM, Sergio Cambra .:: entreCables S.L. ::.
wrote:
http://www.ultrasaurus.com



Sergio Cambra .:: entreCables S.L. ::.

unread,
Jul 2, 2009, 10:11:15 AM7/2/09
to actives...@googlegroups.com
On Jueves, 2 de Julio de 2009 15:06:08 Sarah Allen escribió:
> I wrote this blog post about what I ended up doing:
> http://www.ultrasaurus.com/sarahblog/2009/07/getting-started-with-activesca
>ffold/
>
> What does active_scaffold => true do when added to a route?

Adds routes for actions above standard CRUD.
It adds:
:collection => {:show_search => :get, :update_table => :get, :edit_associated
=> :get, :list => :get, :new_existing => :get},
:member => {:row => :get, :nested => :get, :edit_associated => :get,
:add_association => :get, :update_column => :post}
Reply all
Reply to author
Forward
0 new messages