[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

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

Chad Fowler

10/27/2004 12:18:00 AM

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.rubyo...), which he used
to develop both of these applications.

Check it out at http://www.ruby....

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://chad...
http://rubyc...
http://ruby...
http://rubygems.rub... (over 20,000 gems served!)


9 Answers

Gavin Kistner

10/27/2004 2:58:00 AM

0

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




Bil Kleb

10/27/2004 11:07:00 AM

0

Chad Fowler wrote:
>
> 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.rubyo...), which he used
> to develop both of these applications.
>
> Check it out at http://www.ruby....

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.lar...

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,
--
Bil Kleb, Hampton, Virginia


gabriele renzi

10/27/2004 11:25:00 AM

0

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.rubyo...), which he used
> to develop both of these applications.
>
> Check it out at http://www.ruby....


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.

Hal E. Fulton

10/27/2004 8:10:00 PM

0

Bil Kleb wrote:
>
> This got me thinking: Does anyone want to put our project's site,
>
> http://fun3d.lar...
>
> 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



Bil Kleb

10/27/2004 8:22:00 PM

0

Hal Fulton wrote:
> Bil Kleb wrote:
>>
>> This got me thinking: Does anyone want to put our project's site,
>>
>> http://fun3d.lar...
>>
>> on Rails?
>
> 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,
--
Bil Kleb, Hampton, Virginia


Bill Atkins

10/27/2004 8:45:00 PM

0

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


On Thu, 28 Oct 2004 05:22:19 +0900, Bil Kleb <bil.kleb@nasa.gov> wrote:
> Hal Fulton wrote:
> > Bil Kleb wrote:
> >>
> >> This got me thinking: Does anyone want to put our project's site,
> >>
> >> http://fun3d.lar...
> >>
> >> on Rails?
> >
> > 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,
> --
> Bil Kleb, Hampton, Virginia
>
>


Chad Fowler

10/28/2004 2:08:00 AM

0

On Wed, 27 Oct 2004 20:29:02 +0900, gabriele renzi
<rff_rff@remove-yahoo.it> wrote:
> 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.rubyo...), which he used
> > to develop both of these applications.
> >
> > Check it out at http://www.ruby....
>
>
> 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.
>
>

I can't promise anything soon, but it's on the list.

Chad

--

Chad Fowler
http://chad...
http://rubyc...
http://ruby...
http://rubygems.rub... (over 20,000 gems served!)


vruz

10/30/2004 12:50:00 AM

0

> 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/projec...

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/R...
later, and see if it works.

best,
vruz


Austin Ziegler

10/30/2004 4:32:00 AM

0

On Sat, 30 Oct 2004 09:49:45 +0900, vruz <horacio.lopez@gmail.com> wrote:
> > 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.
> http://www.halostatue.ca/blog/index.cgi/Tech/R...

I am working on a proper redirect, but this will be:

http://www.halostatue.ca/blog.cgi/Tech/R...

-austin
--
Austin Ziegler * halostatue@gmail.com
* Alternate: austin@halostatue.ca
: as of this email, I have [ 5 ] Gmail invitations