Forums | Admin

Discussion Forums: open-discussion

Start New Thread Start New Thread
Message: 61989
BY: David Adler (dadler)
DATE: 2008-11-10 18:01
SUBJECT: RE: Upgrading to Rails 2.1

 

Hi Praveen, thank you for the quick reply.

At this point, it isn't worthwhile for me to pursue this as it was more a matter of curiosity how the 'generate scaffold' and 'generate migration' worked in Rails 2.1.

My environment.rb contains
RAILS_GEM_VERSION = '2.1.2' unless defined? RAILS_GEM_VERSION

rails --version returns
Rails 2.1.2

I normally use Aptana Studio as the IDE. The rake failed with the version message in Aptana Studio but when I ran it from the command line in my application, it worked with the timestamp. It isn't obvious what may need to be changed in the Aptana Studio environment.

I've been using DB2 for almost 20 years so it is easier to code the DDL than use Rails migrations.

My earlier Rails applications had highly customized view definitions so the scaffold generation isn't really useful.

The following is the code generated by scaffold for the list view. I don't see anything that references the actual row data values:

<h1>Listing friends</h1>

<table>
<tr>
</tr>

<% for friend in @friends %>
<tr>
<td><%= link_to 'Show', friend %></td>
<td><%= link_to 'Edit', edit_friend_path(friend) %></td>
<td><%= link_to 'Destroy', friend, :confirm => 'Are you sure?', :method => :delete %></td>
<% for column in Friend.content_columns %>
<td><%=h friend.send(column.name) %></td>
<% end %>
</tr>
<% end %>
</table>

<br />

<%= link_to 'New friend', new_friend_path %>


Thread View

Thread Author Date
Upgrading to Rails 2.1David Adler2008-11-09 14:18
      RE: Upgrading to Rails 2.1Praveen Devarao2008-11-10 11:26
            RE: Upgrading to Rails 2.1David Adler2008-11-10 18:01
                  RE: Upgrading to Rails 2.1David Adler2008-11-10 18:05
                        RE: Upgrading to Rails 2.1Praveen Devarao2008-11-11 05:19

Post a followup to this message