Read my latest article: 8 things I look for in a Ruby on Rails app (posted Thu, 06 Jul 2017 16:59:00 GMT)

Need to upgrade my typo install

Posted by Mon, 04 Apr 2005 18:50:58 GMT

A few reasons why I need to upgrade Typo.

Perhaps something to suggest as a feature would be the concept of ‘themes’ or ‘styles’ for Typo. I’d hate to have to go in and change my css/images each time I want to upgrade. I wonder if Tobi has added my PostgreSQL patch to the tree yet. I know two people who are using it (the pgsql patch) currently. Curt Hibbs and myself.

Since I have started to use Typo (only a few weeks now), the list of people using it on the Typo page has gone from 2 listed to over 20.

Adding AJAX to your existing RAILS app

Posted by Sat, 02 Apr 2005 07:23:35 GMT

As of Rails 0.11.0, the Rails team has added Ajax support into the framework. Tha’ts right, you don’t need to spend a bunch of time reading through the Ajax fundamentals to get it integrated into you application. The Rails team has made this very simple to utilize.

First of all, make sure you have at least Rails 0.11.0 (about a week old as of today). Next, open up one of your rhtml files (example: standard-layout.rhtml if you followed one of the cookbook tutorials).

Add the following line inside the <head> of your html file.
  &lt;%= define_javascript_functions %&gt;

Now in one of your controllers, add your new method.

  def myrandom
    render_text SomeModel.gen_random(10)
  end

In this example, SomeModel is a model that has a method called gen_random which returns a random alphanumeric string 10 characters long in this case (was used in rubyurl.com).

The last piece is to add the following to my rhtml file:

&lt;div id="myrandom"&gt;x&lt;/div&gt;

&lt;%= link_to_remote "Generate Random", 
    :update =&gt; "myrandom", 
    :url =&gt; { :action =&gt; "myrandom" } %&gt;

Now, you should be able to run your RAILS app and it will display a button for me and when I hit ‘Generate Random’ it replaces the <div> content with the random string.

Yep, that’s all it took to add a non page refreshing action to your script. Of course you can do a lot of cool things with AJAX and this wasn’t one of those cool things… just a quick example. :-)

Adding AJAX to your existing RAILS app

Posted by Sat, 02 Apr 2005 07:23:00 GMT

As of Rails 0.11.0, the Rails team has added Ajax support into the framework. Tha’ts right, you don’t need to spend a bunch of time reading through the Ajax fundamentals to get it integrated into you application. The Rails team has made this very simple to utilize.

First of all, make sure you have at least Rails 0.11.0 (about a week old as of today). Next, open up one of your rhtml files (example: standard-layout.rhtml if you followed one of the cookbook tutorials).

Add the following line inside the <head> of your html file.
  &lt;%= define_javascript_functions %&gt;

Now in one of your controllers, add your new method.

  def myrandom
    render_text SomeModel.gen_random(10)
  end

In this example, SomeModel is a model that has a method called gen_randomrubyurl.com).

The last piece is to add the following to my rhtml file:

&lt;div id="myrandom"&gt;x&lt;/div&gt;

&lt;%= link_to_remote "Generate Random", 
    :update =&gt; "myrandom", 
    :url =&gt; { :action =&gt; "myrandom" } %&gt;

Now, you should be able to run your RAILS app and it will display a button for me and when I hit ‘Generate Random’ it replaces the <div> content with the random string.

Yep, that’s all it took to add a non page refreshing action to your script. Of course you can do a lot of cool things with AJAX and this wasn’t one of those cool things… just a quick example. :-)

Lucas shares his secrets

Posted by Sat, 02 Apr 2005 00:54:04 GMT

Lucas Carlson has posted on his blog an entry called, How to Make a Living Programming in Rails which pretty much explains the main steps that you should take when you want to be a freelance developer in the open source world. ( I don’t know if these same base rules work in the proprietary world..so I can’t say if it does or not).

A few things to add to his top 5 list would be to participate in the mailing lists (google indexes that) and get your name out there. In my PHP/PostgreSQL consulting career, many people come to me because they found a code sniplet, or a mailing list archive where I answered a similar question from someone else… these all leads to contacts and potential customers.

As my Ruby/Rails experience is still growing but I have picked up on some of the fundamentals fairly quick, I have been working on a few client projects and one product that will be launched by my company, PLANET ARGON sometime in May or early June.

I hope to meet Lucas in a few weeks when he presents Ruby/Rails at FreeGeek. It’s good to see that there is an active development group in the Portland, OR area.

Lucas shares his secrets

Posted by Sat, 02 Apr 2005 00:54:04 GMT

Lucas Carlson has posted on his blog an entry called, How to Make a Living Programming in Rails which pretty much explains the main steps that you should take when you want to be a freelance developer in the open source world. ( I don’t know if these same base rules work in the proprietary world..so I can’t say if it does or not).

A few things to add to his top 5 list would be to participate in the mailing lists (google indexes that) and get your name out there. In my PHP/PostgreSQL consulting career, many people come to me because they found a code sniplet, or a mailing list archive where I answered a similar question from someone else… these all leads to contacts and potential customers.

As my Ruby/Rails experience is still growing but I have picked up on some of the fundamentals fairly quick, I have been working on a few client projects and one product that will be launched by my company, PLANET ARGON sometime in May or early June.

I hope to meet Lucas in a few weeks when he presents Ruby/Rails at FreeGeek. It’s good to see that there is an active development group in the Portland, OR area.

Older posts: 1 ... 4 5 6