DISQUS

DISQUS Hello!  The comments on this profile are unclaimed and thus are unverified.

Do they belong to you? Claim these comments.

Jonathan's picture

Unregistered

Feeds

aliases

  • Jonathan

Jonathan

1 year ago

in Encode HTML entities in helpers and views in Ruby on Rails | ruby on rails blog on ruby on rails blog
Thanks for the update, I'll adjust the post accordingly!

1 year ago

in Basic Rail’s routing and a journey into Views, and Controllers | ruby on rails blog on ruby on rails blog
I'll add in the database configuration, sometimes I forget all my local development stuff is root with no password :)

1 year ago

in Rails Relationships | ruby on rails blog on ruby on rails blog
You can run sqlite and mongrel at the same time, just do it in different windows.

I run sqlite as follows:
<pre>
ng:bookstore$ sqlite3 db/development.sqlite3
SQLite version 3.4.0
Enter ".help" for instructions
sqlite>

</pre>

1 year ago

in Rails Relationships | ruby on rails blog on ruby on rails blog
Peter and Pawel:

haha, sometimes I get ahead of myself, I'll go back and fix that typo...I think in future posts, I'll just insert random bugs and see if you guys really are paying attention ;)

I'm going to do some writing on nested routes, which is what you described (/books1/author) in my next iteration .

1 year ago

in Ruby on Rails Tutorial, now with more 2.0.2! | ruby on rails blog on ruby on rails blog
Andrew:

The destroy link has a JS confirmation prompt, which you can disable in the view.

It's nothing to fault the framework for, the destroy link you see was the result of a scaffold generation, which allows you get get your application up and running.

If for some reason, you need to run an application that supports non-JS users, of course you will need to make those changes.

Like I've stated before, scaffolding is meant to assist with development...not replace it. How many skyscrapers or houses do you see, post-production, with scaffolding?

1 year ago

in Rails Relationships | ruby on rails blog on ruby on rails blog
Isaac:

Thanks for the kind words. I'm assuming you're talking about this
migration?

<pre>script/generate migration add_author_id_to_books</pre>

If that is the case, it should be empty. When you generate a migration, it will create an empty file. You then proceed to fill in the blanks, the areas between self.up and self.down. It should look like this...

<pre code="rails">
class AddAuthorIdToBooks < ActiveRecord::Migration
def self.up
add_column :books, :author_id, :int
end

def self.down
remove_column :books, :author_id
end
end
</pre>

1 year ago

in Rails Relationships | ruby on rails blog on ruby on rails blog
Adam: Thanks for that clarification, I didn't want to confuse any new users, but you are correct :) I thought about writing in some comments for those who have used the LAMP stack prior to Rails, but decided against it.

1 year ago

in Ruby on Rails Tutorial, now with more 2.0.2! | ruby on rails blog on ruby on rails blog
Yes, you would need to run a scaffold for each model, seperately.

db:migrate will migrate through all of your migrations, so no, you don't need to run it each time, unless of course you need those fields generated in the database immediately.

1 year ago

in Rails Relationships | ruby on rails blog on ruby on rails blog
Your best bet would be the Rails API, the mailing list, or any of the forums.

1 year ago

in Basic Rail’s routing and a journey into Views, and Controllers | ruby on rails blog on ruby on rails blog
The methods (edit_book_path, destroy using :method => :delete, and new_post_path) do not look standard because they use something called resources. This is a little tricky, and I will be devoting a post to it.

Nik: I overlooked that, thanks.
Mitch: Authentication, for what? User login?

1 year ago

in PHP vs Rails | ruby on rails blog on ruby on rails blog
That's true, you can't compare PHP to the Rails framework...but even against cake PHP, Rails is leaps and bounds better!

As for the PHP code that I posted, obviously that code could be drastically reduced with SQL triggers and better code, but for the most part, a new programmer using PHP vs one using Ruby, Ruby is going to be the winner :)

1 year ago

in Ruby on Rails Tutorial, now with more 2.0.2! | ruby on rails blog on ruby on rails blog
Steve, you are getting an error because you aren't running Rails 2.0

Try visiting the link to the ONLAMP article I have posted, or updating to Rails 2.0.

1 year ago

in Ruby on Rails Tutorial, now with more 2.0.2! | ruby on rails blog on ruby on rails blog
pritish:

I have the command to generate a Rails app for use with a MySQL database, maybe I will make it bold so it's clearer.

As for, rake db:create:all, I've never used it...EVER :P Thanks for posting, perhaps somebody else will have that problem.

1 year ago

in Rails send email tutorial | ruby on rails blog on ruby on rails blog
All- I'll address your comments shortly. I've been working non-stop to meet our April 2nd deadline for the free online dating site we've been working on!

1 year ago

in Change Rails’ layout via controller | ruby on rails blog on ruby on rails blog
I had the same problem trying to figure that out :) Glad I could help!

1 year ago

in Change Rails’ layout via controller | ruby on rails blog on ruby on rails blog
Steve, this should make sense, if not, let me know.

<pre lang="ruby" line="1">
class DashboardController < ApplicationController
layout 'primary'

def index
@everything = Stuff.find(:all)
end

def show
@something = Stuff.find(params[:id])
render :layout => "secondary"
end

end

</pre>

1 year ago

in Change Rails’ layout via controller | ruby on rails blog on ruby on rails blog
Steve, try something like this inside your method:

<pre lang="rails" line="0">
render :action => "index", :layout => "help"
</pre>

1 year ago

in Calculate age in Rails with a birthday | ruby on rails blog on ruby on rails blog
Thanks for that post. When we did the age calculation it was meant to give us an approximation of our user base. Since it was not critical to have 100% accurate information, leap year was overlooked :)

1 year ago

in Testing with Basic HTTP Authentication in Rails 2.0 | ruby on rails blog on ruby on rails blog
It's always kind of cool when random people read your blog and you can help them :)
Returning? Login