Is the equality failing or is something else going on?

I'm trying to prototype, but I'm running into an error after modifying
the scaffolding slightly.

       if( == 'content')
           render_template 'rhtml', page.send(

I have a datetime field and I'm getting this error "can't convert Time
into String" and the render_template line is causing the problem. The
'content' column isn't a datetime field. So the if statement is

It looks like you're using the old-style render_template... not sure if that's causing difficulty or not. Try this:

render :template => "path/to/template"

You could try this too, although I'm not certain I'm thinking the same thing you're thinking:

render :template => "path/to/#{}", :locals => {:value => page.send(}

Then, in each of your #{}.rhtml files, you will have a local variable called 'value' which contains the value of the relevant column.

Another question, I'm trying to pretty this up using an 'unless'
statement but I can't seem to figure it out

<%= page.send unless =='content' render_template 'rhtml',
page.send( %> doesn't seem to work either. Rails spits out
a problem with a missing ')' after 'render_template'. Any ideas?

It looks like you're trying to do an unless / else statement on one line, so you'll need a 'then' and an 'else'. You'll also need to clean up the code a little, as it seems you're not actually 'send'ing anything to 'page'... actually, I'm not sure about that, but the Ruby syntax isn't right anyway, so maybe that's why the parser in my head won't work :slight_smile:

<%= unless =='content' then render_template('rhtml', page.send( else page.send( end %>

Duane Johnson