Scaffold with 1-M?

So Iâ??ve been following streamlined
(http://streamlined.relevancellc.com/) and Ajax Scaffold for awhile and
they look like great tools. However Iâ??m looking for a tool thatâ??s more
like a scaffolding on steroids rather than an admin CRUD tool.

What Iâ??m looking for is a generator I can use to do rapid prototyping
with a client (like scaffold) but that can at least handle 1-M stuff
(has_many, belongs_to) etc. The resulting prototype â??enhanced scaffoldâ??
can then be used as a starting place for the real app, so it has to be
extremely spartan (like current scaffold). Does anyone know of a tool
like this out there? Cheers.

On 8/24/06, inboulder [email protected] wrote:

like this out there? Cheers.
Not sure if it will do everything you want, but you may want to look
at the Scaffolding Extensions plugin [1].

[1]
http://wiki.rubyonrails.com/rails/pages/Scaffolding+Extensions+Plugin

Jeremy E. wrote:

[1]
http://wiki.rubyonrails.com/rails/pages/Scaffolding+Extensions+Plugin

Hi, I’ve taken a look at that b/f, but it appears to be a plugin and not
a generator, so it’s not really a way of creating a bare bones app to
build on top of. Am I correct in thinking this?

I recently installed and I believe properly configured the Globalize
plugin. However, it seems to work in one view and not another.

I have two product views - one for a listing of multiple products and
one for a listing of a single product’s details. My base language is set
in environment.rb as:

include Globalize
Locale.set_base_language ‘en-US’
Locale.set ‘en-US’

I have a controller called product. Here’s the index method snippet (I’m
setting the Locale explicitly to test it out):

def index
Locale.set “es-ES”
@products = Product.find(:all, :order => “date_added”, :conditions
=> @@active

My product model looks like:

class Product < ActiveRecord::Base

translates :name, :description

In this case, Globalize works correctly and displays the Spanish names
correctly as seen in screenshot:
http://www.tmpforums.com/images/tam/listings.jpg

The product_details method looks like:

def product_details
begin
Locale.set “es-ES”
@product = Product.find(params[:id], :conditions => @@active)

However, no matter what I do, it always keeps displaying the English
name in this view:
http://www.tmpforums.com/images/tam/details.jpg

I took a look at the globalize_translations table and to the best of my
knowledge it looks fine:
http://www.tmpforums.com/images/table.jpg

I’ve checked the view template and I’m not changing the locale in the
view at all. I’ve even tried setting the locale in the view template to
“es-ES” and it STILL displays it as English. I have no idea what I’m
doing wrong, but I suspect it’s something subtle I’m missing. Would
really appreciate any help with this. Thanks!

Best Regards,

Tamim

I just found something strange. I changed the following:

def product_details
begin
Locale.set “es-ES”
@product = Product.find(params[:id], :conditions => @@active)

*TO THIS:
*

def product_details
begin
Locale.set “es-ES”
@product = Product.find(:all, :conditions => “id = #{params[:id]}
AND #{@@active}”)
@product = @product[0]

And in this case Globalize returns the translated name. But why does it
not return it when I use Product.find?

On 8/24/06, inboulder [email protected] wrote:

[1]
http://wiki.rubyonrails.com/rails/pages/Scaffolding+Extensions+Plugin

Hi, I’ve taken a look at that b/f, but it appears to be a plugin and not
a generator, so it’s not really a way of creating a bare bones app to
build on top of. Am I correct in thinking this?

Yes. However, I recently commited some changes that allow you to
generate controller code with it, and you’ve always been able to copy
to scaffold views and modify them. Not a true generator, but one of
the main advantages of the plugin is that it (is|should be) flexible
enough that you don’t need to modify the output.

The plugin handles belongs_to, has_many, and habtm associations, but
it is more suited to do admin CRUD than to be a true scaffold (in
spite of the name). That said, it includes features that make rich
user accessible forms easy to build, if you don’t mind reading the
RDoc or looking at the code.