[ANN] New RubyGarden article: "Reflections on Rails"

C

Chad Fowler

Rubyists,

Hot on the heels of his RubyGarden FAQ rewrite and the release of a
new and improved RCRchive.net comes an article by David A. Black on
his experiences with Rails (http://www.rubyonrails.org), which he used
to develop both of these applications.

Check it out at http://www.rubygarden.org.

I hope this to be the first in a long stream of articles, tutorials,
and interviews to grace the pages of RubyGarden.org.

If you're interested in writing an article or have an idea you'd
like to see covered, please contact me directly. I'm hoping to soon
establish a rhythm of regular new content on the site. Don't be
surprised if I hit some of you up directly for new content (some of
you have already been tapped). :)

--
Chad Fowler
http://chadfowler.com
http://rubycentral.org
http://rubygarden.org
http://rubygems.rubyforge.org (over 20,000 gems served!)
 
G

Gavin Kistner

Great article!

One comment:
def search
terms = @params['search']['terms'].scan(/"(.*?)"|([^"\s]+)/).
flatten.compact
cond = "body LIKE '%#{terms[0]}%' "
cond << terms[1..-1].map {|t| " AND body LIKE '%#{t}%'"}.join("")
@results = Entry.find_all(cond)
end

But most of the scrappiness has to do with the piecing together of the
SQL condition. Once all that is in place, the last line of the method
body does everything that’s needed to prepare the environment for the
view. (Note: readers are invited to send me ideas for cleaner ways to
generate that multiple condition line!)

For the one bit I unerstand, how about:
def search
terms =
@params['search']['terms'].scan(/"(.*?)"|([^"\s]+)/).flatten.compact
@results = Entry.find_all terms.map{ |t| "body LIKE '%#{t}%'"
}.join( ' AND ' )
end
 
B

Bil Kleb

Chad said:
Hot on the heels of his RubyGarden FAQ rewrite and the release of a
new and improved RCRchive.net comes an article by David A. Black on
his experiences with Rails (http://www.rubyonrails.org), which he used
to develop both of these applications.

Check it out at http://www.rubygarden.org.

Black writes:

Reworking the FAQ site was on Chad’s to-do list, and finding
an enjoyable and useful Rails project was on mine. So I took
on the FAQ.

This got me thinking: Does anyone want to put our project's site,

http://fun3d.larc.nasa.gov

on Rails? It's on my to-do list. :)

In it's current state it is nearly impossible to change; and to
a certain extent, embarrassing.

Regards,
 
G

gabriele renzi

Chad Fowler ha scritto:
Rubyists,

Hot on the heels of his RubyGarden FAQ rewrite and the release of a
new and improved RCRchive.net comes an article by David A. Black on
his experiences with Rails (http://www.rubyonrails.org), which he used
to develop both of these applications.

Check it out at http://www.rubygarden.org.


lovely to hear! thank you all for this.
Anyway, a question: there is a chance to have a comment system on
rubygarden? IIRC some time ago there was talkingabout a rublog patch to
allow that.
 
H

Hal Fulton

Bil said:
This got me thinking: Does anyone want to put our project's site,

http://fun3d.larc.nasa.gov

on Rails? It's on my to-do list. :)

In it's current state it is nearly impossible to change; and to
a certain extent, embarrassing.

It's not that bad. The graphics have got the jaggies. Definitely
a super-nerd site. :)

I'm wondering, is this a place where Rails could really shine? I
mean, it's mostly static HTML, isn't it?

If so, then Rails is even more interesting than I thought...
personally I have not yet jumped on the bandwagon, though I trust
the people who tell me how cool it is.


Hal
 
B

Bil Kleb

Hal said:
I'm wondering, is this a place where Rails could really shine?

I don't know.

I am thinking that at least the frozen-in-stone nav bar might
be thawed, that a simple content insertion mechism for gallery
items might be possible, that the RSS commit feed might be better
integrated, or that the users manual might be auto-generated
from some marked-up text.
I mean, it's mostly static HTML, isn't it?

It's all static HTML because that's really all we know or
seem to have time for.

Regards,
 
B

Bill Atkins

My impression was that Rails was best for database-intensive
applications. Is this true? If Rails would indeed be appropriate for
a static website, then I might start to look into it.

Bill
 
V

vruz

I am thinking that at least the frozen-in-stone nav bar might
be thawed, that a simple content insertion mechism for gallery
items might be possible, that the RSS commit feed might be better
integrated, or that the users manual might be auto-generated
from some marked-up text.

Sounds more like a job for Ruwiki.
http://rubyforge.org/projects/ruwiki/

The latest tarball there is release 0.7 which is a bit dated now.

Ruwiki is very extensible, supports definition of new markup and
pluggable storage backends. (you can code a database storage plugin
very quickly)

Austin Ziegler has reported he's about to release 0.9 soon, and it
seems like it's well worth the wait.
I can't access his website right now, it's probably under maintenance.
Perhaps you can have a look at
http://www.halostatue.ca/blog/index.cgi/Tech/Ruby/Ruwiki
later, and see if it works.

best,
vruz
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top