small medium large xlarge

Generic-user-small
02 Aug 2008, 19:14
Max Norman (17 posts)

I have recently just started with this book, and have gotten to page 82, on which there is the code for the ‘new.html.erb’ document of the depot application.

What I am puzzled over is the fact that the files that I generated on my computer are very different. Instead of generating the title using ERB, they are already statically displayed.

Should I leave them that way?

Generic-user-small
02 Aug 2008, 19:27
James West (104 posts)

I’m not sure I understand your situation properly but could it be a difference in Rails versions? Are you running Rails 2.1?

Generic-user-small
02 Aug 2008, 19:31
Max Norman (17 posts)

no. I am running rails 2.02

Samr_small_pragsmall
02 Aug 2008, 20:27
Sam Ruby (634 posts)

The difference isn’t significant. You can leave them that way.

The code generated by Rails 2.0.2 looks like

  <p>
    <b>Title</b><br />
    <%= f.text_field :title %>
  </p>

The code generated by Rails 2.1.0 looks like

  <p>
    <%= f.label :title %><br />
    <%= f.text_field :title %>
  </p>
Generic-user-small
02 Aug 2008, 21:10
Max Norman (17 posts)

After I finish the depot project, should I update rails?

Samr_small_pragsmall
02 Aug 2008, 21:49
Sam Ruby (634 posts)

Completely up to you. Apart from minor differences, the major difference in terms of impact to the book is how Rails names and tracks migrations.

If you were to install the gems for Rails 2.1.0, your existing depot application will continue to use Rails 2.0.2. This is controlled by the setting of RAILS_GEM_VERSION in config/environment.rb.

You must be logged in to comment