more info

Media72 Hosting Articles and Tips

10 Ruby On Rails Plugins You Should Be Using

December 9th, 2007

One of Ruby on Rails strengths is how easy it is to extend with Ruby Gems and plugins, becuase you don’t have to code everything yourself you can save a lot of time. One problem facing Rails codes is knowing what plugins are out there and how to use them. The following is a list of 10 plugins that should make your coding life much easier and save you a fair bit of time.
Read the rest of this entry »

Upgrading to Rails 2.0 how to

December 9th, 2007

Ben Smith has written some Rails 2 upgrade notes which cover the process of upgrading and existing application to Rails 2.0. Included in the article is a rake task for checking depreciation warnings before you upgrade which is very useful.

Rails 2.0 causing startup errors for some customers

December 8th, 2007

After upgrading our servers to Rails 2.0 it has come to our attention this has caused problems for some customers rails applications where the application will fail to start. This will happen when your application is not set to use a specific version of rails and will therefor load the most recent version of rails. On servers where customers have been affected we have removed rails 2.0. This is a temporary measure to give customers time to upgrade their applications. We will be reinstalling rails 2.0 on all servers on Friday 14th December. Read on to see how to make sure your rails application will still work after the upgrade.
Read the rest of this entry »

Ruby on Rails 2.0 released and installed on all servers

December 7th, 2007

Thats right folks, today is a big day for Rails and marks the release of version 2.0. For a full run down see DHH’s post on the the Ruby on Rails site. We have already upgraded all of our servers to include Rails 2.0.1 so that you guys can get your teeth into it straight away. Sign up with any one of our rails accounts and get instant access to Rails 2.0.
Read the rest of this entry »

Domain Registration Site Back Up

November 30th, 2007

Our domain registration service is now available again through https://domains.media72.co.uk the issue has been fixed. As part of the fixed we changed the DNS entry to a new IP address, some user may find it takes up to 24 hours to see this change. Thank you to all our customers for your patience and understanding.

Domain Registration Site Down

November 29th, 2007

Our domain registration site is currently down which means any new registrations and domain administration is not possible until the problem has been resolved. Unfortunately this issue is beyond our control as the problem is with our domain resellers system where the domains website is hosted. They are aware of the problem and are currently working to resolve the issue. We hope they will have the service running again soon.

Rails Development on Windows

November 29th, 2007

Well this one passed us by at Media72 (probably because we are predominantly a mac based company), there is a replacement for Instant rails the in-a-box rails development environment for windows. RubyStack from BitNami is a “Ruby on Rails is a full-stack MVC framework for database-backed web applications that is optimized for programmer happiness and sustainable productivity”, so there you go!
Read the rest of this entry »

Preparing for Rails 2.0

October 31st, 2007

Anyone that has used Rails 1.2.3, 1.2.4 or 1.2.5 may have noticed a number of deprecation notices in their development logs. Whilst these deprecated methods still work as expected in 1.2.x versions, you will come-a-cropper when you try to upgrade to Rails 2.0. So what do you need to do and what tools are out there to help you with the move? Glad you asked.

The first thing you can do it run your code through a code checker — Geoffrey Grosenbach has released a great rake task which digs through your code looking for the old methods. It will give you hints of how to fix the issues, but lets look at them a little more closely.

@params, @session, @flash, @env

As of Rails 2.0, you won’t be able to directly access the above instance variables. They have been replaced with methods, which makes customising their actions much easier. It also allows the internals of Rails to change without breaking the API. This is very easy to fix – just remove the @ in front of those variables – they will work exactly the same.

find_all, find_first, render_partial

In earlier version of Rails there were a number of grouped methods, that do very similar things – find, find_all and find_first all fetch records from the database, the only difference is the number of records they return. It was decided to combine these methods in to one where they are differentiated by passed in options. So find_all becomes find(:all) and find_first becomes find(:first) and render_partial becomes render(:partial).

Forms

Out of all the HTML helpers, the form tag was an anomaly because it required a start AND end helper. To make it fit in with way the rest of Rails works and to facilitate dynamic form generation, a block method called form_tag was created. This particular update has a trap in it through – because blocks don’t return values, the ERB tag you use must not have an = sign, so


   <%= start_form_tag %>
       <!-- Form stuff -->
   <%= end_form_tag %>

becomes


    <% form_tag do %>
        <!-- Form stuff -->
    <% end %>

Notice the omission of the equals sign in the latter example?

Also note that passing :post => %gt; true is deprecated. With the push for RESTfulness, the form needs to know about the other HTTP verbs, put and delete, so a new option has been created:


    <% form_tag :method => :post do %>
        <!-- Form stuff -->
    <% end %>

Plugins

A number of what used to be core components of rails have been moved out into plug-ins so as not to clutter the core with stuff that you don’t use very often. It also means that the development of the plugins can be much quicker than that of the core. Probably the major extraction is the third-party database interfaces. Now, by default only MySQL, SQLite and PostgreSQL are supported out of the box. All other databases are supported via gems named activerecord-database-adapter. If you want to use an Oracle just run

gem activerecord-oracle-adapter

and you will be peachy again.

Other extractions of note are the acts_as plug-ins. If you use acts_as_tree or acts_as_list in your model, you will need to script/plugin install them and the built-in pagination has now become the classic_pagination plug-in. Note that by the developers own admission that plug-in is slow (and was slow when it was in core), so if you use it, you may want to think about migrating across to the new and improved will_paginate plug-in.

So hop to it and get your web apps upgraded now before the rush!

This article provided by sitepoint.com.

 

hedges