[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

passing html params in Ruby

jplantz

2/9/2007 6:17:00 PM

I have an AJAX page that I built.
The user enters in some info.
I format a query string and want use it to query my DB.

something like this:

var query_string = "SELECT * FROM mydbtable;

<%
require 'dbi'
require 'cgi'
cgi = CGI.new
params = cgi.params

new_query_string = cgi.params['query_string']

dbh =
DBI.connect("dbi:Pg:dbname=blank;host=blank;port=blank","blank","blank")

newsth = dbh.execute("#{new_query_string}")

rows = newsth.fetch_all

%>

the query_string variable is not passed in the 'params', so obviously
this code is never going to work.
How do I pass the formatted variable (query_string) into my embedded
ruby code so that I can query my DB?

Thank you in advance.

19 Answers

Hunter

5/28/2012 7:03:00 PM

0

On Sat, 26 May 2012 10:03:27 -0700, Arthur Lipscomb
<arthur@alum.calberkeley.org> wrote:

>On 5/26/2012 4:27 AM, Obveeus wrote:
>> With the summer TV season underway and nothing actually on television
>
>
>I love times like this when I can catch up not only on my massive DVR
>backlog but my even larger blu-ray collection.
>
>
>>
>> What did you watch?
>>
>>
>
>Revenge (recorded) - Like the previous episode I'm not sure what
>happened and don't care. And why did they stick in the subplot at the
>school. From what I made out the Grayson daughter ruins the reputation
>of some girl because she was dating a guy she liked. I'll probably be
>back for season 2 but I won't stick around if they don't get back to the
>revenge business.
------
It served as a vehicle to show how Charlotte was spiteful like her
mother and so Declan would reject her in her hour of need, namely that
her mother Victoria Grayson just died in a plane crash that her father
arranged. The bomb was planted by the guy that Emily (Real Amanda)
beat the shit out of but let live. Because of that Charlotte took an
overdose of pills. Her father Conrad found her but we don't know how
long she was down.

Fake Amanda is pregnant with Jack's baby. Emily found out just when
she was about to confess all to Jack and after she broke up with Danny

Mind you the moral of the show is that the toll that revenge takes is
as bad on the seeker as on the victim of it, and a lot of innocent
people have been affected even killed because of her quest.

And the revenge factor is very much alive. It was through Emily's
actions that all that happened.
>
>Rookie Blue (recorded) - I think others liked this a lot more than I
>did. It was little more than background noise to me.
-----
It is one of my "5" ratings. If "10" is the best ("Battlestar
Galactica", "Mad Men") are the best "7" being good ("The Good Wife")
"6" is decent ("Terra Nova", "Alcatraz", "Revenge") and 1 is the worse
(I don't bother remembering them) "5" is good enough to watch and be
entertained but if it is canceled tomorrow Who cares? "Rookie Blue" is
that. So was "Unforgettable".

"Pan Am" was a 6.5
(Snip)

------>Hunter

"No man in the wrong can stand up against
a fellow that's in the right and keeps on acomin'."

-----William J. McDonald
Captain, Texas Rangers from 1891 to 1907

Arthur Lipscomb

5/28/2012 7:11:00 PM

0

On 5/28/2012 12:02 PM, Hunter (Hunter) wrote:
> On Sat, 26 May 2012 10:03:27 -0700, Arthur Lipscomb
> <arthur@alum.calberkeley.org> wrote:
>
>> On 5/26/2012 4:27 AM, Obveeus wrote:
>>> With the summer TV season underway and nothing actually on television
>>
>>
>> I love times like this when I can catch up not only on my massive DVR
>> backlog but my even larger blu-ray collection.
>>
>>
>>>
>>> What did you watch?
>>>
>>>
>>
>> Revenge (recorded) - Like the previous episode I'm not sure what
>> happened and don't care. And why did they stick in the subplot at the
>> school. From what I made out the Grayson daughter ruins the reputation
>> of some girl because she was dating a guy she liked. I'll probably be
>> back for season 2 but I won't stick around if they don't get back to the
>> revenge business.
> ------
> It served as a vehicle to show how Charlotte was spiteful like her
> mother and so Declan would reject her in her hour of need, namely that
> her mother Victoria Grayson just died in a plane crash that her father
> arranged. The bomb was planted by the guy that Emily (Real Amanda)
> beat the shit out of but let live. Because of that Charlotte took an
> overdose of pills. Her father Conrad found her but we don't know how
> long she was down.
>
> Fake Amanda is pregnant with Jack's baby. Emily found out just when
> she was about to confess all to Jack and after she broke up with Danny
>
> Mind you the moral of the show is that the toll that revenge takes is
> as bad on the seeker as on the victim of it, and a lot of innocent
> people have been affected even killed because of her quest.
>

I don't care about the toll it takes on her. This isn't the kind of
show that address issue like that very well. I just want the revenge of
the week. When the show is doing that it works when it strays from that
formula it gets tedious.


> And the revenge factor is very much alive. It was through Emily's
> actions that all that happened.
>>
>> Rookie Blue (recorded) - I think others liked this a lot more than I
>> did. It was little more than background noise to me.
> -----
> It is one of my "5" ratings. If "10" is the best ("Battlestar
> Galactica", "Mad Men") are the best "7" being good ("The Good Wife")
> "6" is decent ("Terra Nova", "Alcatraz", "Revenge") and 1 is the worse
> (I don't bother remembering them) "5" is good enough to watch and be
> entertained but if it is canceled tomorrow Who cares? "Rookie Blue" is
> that. So was "Unforgettable".
>

I generally agree. I just vaguely remember Rookie Blue being slightly
better than that last season but maybe it wasn't.


> "Pan Am" was a 6.5
> (Snip)
>
> ------>Hunter
>
> "No man in the wrong can stand up against
> a fellow that's in the right and keeps on acomin'."
>
> -----William J. McDonald
> Captain, Texas Rangers from 1891 to 1907

"Those are brave men knocking at our door. Let's go Kill them!"
Tyrion, "Game of Thrones"

Ian J. Ball

5/29/2012 3:26:00 PM

0

In article <jq0ik5$ape$1@dont-email.me>,
Arthur Lipscomb <arthur@alum.calberkeley.org> wrote:

> On 5/28/2012 12:02 PM, Hunter (Hunter) wrote:
> > On Sat, 26 May 2012 10:03:27 -0700, Arthur Lipscomb
> > <arthur@alum.calberkeley.org> wrote:
> >> On 5/26/2012 4:27 AM, Obveeus wrote:
> >>>
> >>> What did you watch?
> >>
> >> Revenge (recorded) - Like the previous episode I'm not sure what
> >> happened and don't care. And why did they stick in the subplot at the
> >> school. From what I made out the Grayson daughter ruins the reputation
> >> of some girl because she was dating a guy she liked. I'll probably be
> >> back for season 2 but I won't stick around if they don't get back to the
> >> revenge business.
> > [snip]
> > Mind you the moral of the show is that the toll that revenge takes is
> > as bad on the seeker as on the victim of it, and a lot of innocent
> > people have been affected even killed because of her quest.
>
> I don't care about the toll it takes on her. This isn't the kind of
> show that address issue like that very well. I just want the revenge of
> the week. When the show is doing that it works when it strays from that
> formula it gets tedious.

What toll?! Bitch Amanda hasn't *done* anything!! She wouldn't even kill
the guy who killed her father! She's such a wuss that she has basically
nothing to feel sorry for!!!

This show has become an absolute joke, IMO - there's basically *no*
"revenge", and it's too milquetoast to even work as a nighttime sudser.

Along with "2 Broke Girls", "Revenge" is the show that I most hope gets
some post-season #1 'retooling'...

--
"We're gonna need a lot of therapy." - the character Rachel in "Bunnyman"
(named 1 of the 5 Worst Horror Films of 2011 by 28DaysLaterAnalysis.com!!)

suzeeq

5/29/2012 3:44:00 PM

0

Ian J. Ball wrote:
> In article <jq0ik5$ape$1@dont-email.me>,
> Arthur Lipscomb <arthur@alum.calberkeley.org> wrote:
>
>> On 5/28/2012 12:02 PM, Hunter (Hunter) wrote:
>>> On Sat, 26 May 2012 10:03:27 -0700, Arthur Lipscomb
>>> <arthur@alum.calberkeley.org> wrote:
>>>> On 5/26/2012 4:27 AM, Obveeus wrote:
>>>>> What did you watch?
>>>> Revenge (recorded) - Like the previous episode I'm not sure what
>>>> happened and don't care. And why did they stick in the subplot at the
>>>> school. From what I made out the Grayson daughter ruins the reputation
>>>> of some girl because she was dating a guy she liked. I'll probably be
>>>> back for season 2 but I won't stick around if they don't get back to the
>>>> revenge business.
>>> [snip]
>>> Mind you the moral of the show is that the toll that revenge takes is
>>> as bad on the seeker as on the victim of it, and a lot of innocent
>>> people have been affected even killed because of her quest.
>> I don't care about the toll it takes on her. This isn't the kind of
>> show that address issue like that very well. I just want the revenge of
>> the week. When the show is doing that it works when it strays from that
>> formula it gets tedious.
>
> What toll?! Bitch Amanda hasn't *done* anything!! She wouldn't even kill
> the guy who killed her father! She's such a wuss that she has basically
> nothing to feel sorry for!!!
>
> This show has become an absolute joke, IMO - there's basically *no*
> "revenge", and it's too milquetoast to even work as a nighttime sudser.

So does it only count as revenge if she kills people?

Mason Barge

5/29/2012 4:20:00 PM

0

On Tue, 29 May 2012 09:44:01 -0600, suzeeq <suzee@imbris.com> wrote:

>Ian J. Ball wrote:
>> In article <jq0ik5$ape$1@dont-email.me>,
>> Arthur Lipscomb <arthur@alum.calberkeley.org> wrote:
>>
>>> On 5/28/2012 12:02 PM, Hunter (Hunter) wrote:
>>>> On Sat, 26 May 2012 10:03:27 -0700, Arthur Lipscomb
>>>> <arthur@alum.calberkeley.org> wrote:
>>>>> On 5/26/2012 4:27 AM, Obveeus wrote:
>>>>>> What did you watch?
>>>>> Revenge (recorded) - Like the previous episode I'm not sure what
>>>>> happened and don't care. And why did they stick in the subplot at the
>>>>> school. From what I made out the Grayson daughter ruins the reputation
>>>>> of some girl because she was dating a guy she liked. I'll probably be
>>>>> back for season 2 but I won't stick around if they don't get back to the
>>>>> revenge business.
>>>> [snip]
>>>> Mind you the moral of the show is that the toll that revenge takes is
>>>> as bad on the seeker as on the victim of it, and a lot of innocent
>>>> people have been affected even killed because of her quest.
>>> I don't care about the toll it takes on her. This isn't the kind of
>>> show that address issue like that very well. I just want the revenge of
>>> the week. When the show is doing that it works when it strays from that
>>> formula it gets tedious.
>>
>> What toll?! Bitch Amanda hasn't *done* anything!! She wouldn't even kill
>> the guy who killed her father! She's such a wuss that she has basically
>> nothing to feel sorry for!!!
>>
>> This show has become an absolute joke, IMO - there's basically *no*
>> "revenge", and it's too milquetoast to even work as a nighttime sudser.
>
>So does it only count as revenge if she kills people?

Well, she did swear to kill the man who killed her father.

But I think Ian would be satisfied to see some people go to prison or
simply get ruined, financially and socially. Well, I can't speak for him,
but I would.

Point is, the shows steps farther away from the entire concept every
week. It's getting closer and closer to the continuous rolling,
unresolved plots of a true daytime soap opera.

Ian J. Ball

5/29/2012 4:39:00 PM

0

On May 29, 9:19 am, Mason Barge <masonba...@gmail.com> wrote:
> On Tue, 29 May 2012 09:44:01 -0600, suzeeq <su...@imbris.com> wrote:
> >Ian J. Ball wrote:
> >> In article <jq0ik5$ap...@dont-email.me>,
> >>  Arthur Lipscomb <art...@alum.calberkeley.org> wrote:
>
> >>> [On "Revenge":]
> >>> I don't care about the toll it takes on her.  This isn't the kind of
> >>> show that address issue like that very well.  I just want the revenge of
> >>> the week.  When the show is doing that it works when it strays from that
> >>> formula it gets tedious.
>
> >> What toll?! Bitch Amanda hasn't *done* anything!! She wouldn't even kill
> >> the guy who killed her father! She's such a wuss that she has basically
> >> nothing to feel sorry for!!!
>
> >> This show has become an absolute joke, IMO - there's basically *no*
> >> "revenge", and it's too milquetoast to even work as a nighttime sudser.
>
> >So does it only count as revenge if she kills people?
>
> Well, she did swear to kill the man who killed her father.
>
> But I think Ian would be satisfied to see some people go to prison or
> simply get ruined, financially and socially.  Well, I can't speak for him,
> but I would.
>
> Point is, the shows steps farther  away from the entire concept every
> week.  It's getting closer and closer to the continuous rolling,
> unresolved plots of a true daytime soap opera.

The show has no "edge".
"NCIS:LA" has way more 'edge'.

Let me say that again:

NCIS:LA has MORE 'edge' than "Revenge".

If that doesn't tell you everything you need to know in one simple
sentence, I don't know what would.

I can't think of a network show currently airing that has less 'edge'
than "Revenge".

That, in a nutshell, is everything that's wrong with the show:

It's completely milquetoast.

suzeeq

5/29/2012 5:46:00 PM

0

Mason Barge wrote:
> On Tue, 29 May 2012 09:44:01 -0600, suzeeq <suzee@imbris.com> wrote:
>
>> Ian J. Ball wrote:
>>> In article <jq0ik5$ape$1@dont-email.me>,
>>> Arthur Lipscomb <arthur@alum.calberkeley.org> wrote:
>>>
>>>> On 5/28/2012 12:02 PM, Hunter (Hunter) wrote:
>>>>> On Sat, 26 May 2012 10:03:27 -0700, Arthur Lipscomb
>>>>> <arthur@alum.calberkeley.org> wrote:
>>>>>> On 5/26/2012 4:27 AM, Obveeus wrote:
>>>>>>> What did you watch?
>>>>>> Revenge (recorded) - Like the previous episode I'm not sure what
>>>>>> happened and don't care. And why did they stick in the subplot at the
>>>>>> school. From what I made out the Grayson daughter ruins the reputation
>>>>>> of some girl because she was dating a guy she liked. I'll probably be
>>>>>> back for season 2 but I won't stick around if they don't get back to the
>>>>>> revenge business.
>>>>> [snip]
>>>>> Mind you the moral of the show is that the toll that revenge takes is
>>>>> as bad on the seeker as on the victim of it, and a lot of innocent
>>>>> people have been affected even killed because of her quest.
>>>> I don't care about the toll it takes on her. This isn't the kind of
>>>> show that address issue like that very well. I just want the revenge of
>>>> the week. When the show is doing that it works when it strays from that
>>>> formula it gets tedious.
>>> What toll?! Bitch Amanda hasn't *done* anything!! She wouldn't even kill
>>> the guy who killed her father! She's such a wuss that she has basically
>>> nothing to feel sorry for!!!
>>>
>>> This show has become an absolute joke, IMO - there's basically *no*
>>> "revenge", and it's too milquetoast to even work as a nighttime sudser.
>> So does it only count as revenge if she kills people?
>
> Well, she did swear to kill the man who killed her father.
>
> But I think Ian would be satisfied to see some people go to prison or
> simply get ruined, financially and socially. Well, I can't speak for him,
> but I would.

She's working to that point. Conrad seems to be a step ahead of her
though. The white haired man may have done the actual killing of her
father, but he did say something like he didn't do it.

> Point is, the shows steps farther away from the entire concept every
> week. It's getting closer and closer to the continuous rolling,
> unresolved plots of a true daytime soap opera.

They set it up for next season that Grayson answers to someone above him
- maybe in the government...? - so she'll be wanting to go after them.

Mason Barge

5/29/2012 5:54:00 PM

0

On Tue, 29 May 2012 09:39:03 -0700 (PDT), "Ian J. Ball" <ijball@mac.com>
wrote:

>On May 29, 9:19?am, Mason Barge <masonba...@gmail.com> wrote:
>> On Tue, 29 May 2012 09:44:01 -0600, suzeeq <su...@imbris.com> wrote:
>> >Ian J. Ball wrote:
>> >> In article <jq0ik5$ap...@dont-email.me>,
>> >> ?Arthur Lipscomb <art...@alum.calberkeley.org> wrote:
>>
>> >>> [On "Revenge":]
>> >>> I don't care about the toll it takes on her. ?This isn't the kind of
>> >>> show that address issue like that very well. ?I just want the revenge of
>> >>> the week. ?When the show is doing that it works when it strays from that
>> >>> formula it gets tedious.
>>
>> >> What toll?! Bitch Amanda hasn't *done* anything!! She wouldn't even kill
>> >> the guy who killed her father! She's such a wuss that she has basically
>> >> nothing to feel sorry for!!!
>>
>> >> This show has become an absolute joke, IMO - there's basically *no*
>> >> "revenge", and it's too milquetoast to even work as a nighttime sudser.
>>
>> >So does it only count as revenge if she kills people?
>>
>> Well, she did swear to kill the man who killed her father.
>>
>> But I think Ian would be satisfied to see some people go to prison or
>> simply get ruined, financially and socially. ?Well, I can't speak for him,
>> but I would.
>>
>> Point is, the shows steps farther ?away from the entire concept every
>> week. ?It's getting closer and closer to the continuous rolling,
>> unresolved plots of a true daytime soap opera.
>
>The show has no "edge".
>"NCIS:LA" has way more 'edge'.
>
>Let me say that again:
>
>NCIS:LA has MORE 'edge' than "Revenge".
>
>If that doesn't tell you everything you need to know in one simple
>sentence, I don't know what would.
>
>I can't think of a network show currently airing that has less 'edge'
>than "Revenge".

I thought "Blade" had a lot of edge.

Anim8rFSK

5/29/2012 6:36:00 PM

0

In article
<7e4c239c-38c2-4c9b-bce7-7061ab1b409e@oo8g2000pbc.googlegroups.com>,
"Ian J. Ball" <ijball@mac.com> wrote:

> On May 29, 9:19?am, Mason Barge <masonba...@gmail.com> wrote:
> > On Tue, 29 May 2012 09:44:01 -0600, suzeeq <su...@imbris.com> wrote:
> > >Ian J. Ball wrote:
> > >> In article <jq0ik5$ap...@dont-email.me>,
> > >> ?Arthur Lipscomb <art...@alum.calberkeley.org> wrote:
> >
> > >>> [On "Revenge":]
> > >>> I don't care about the toll it takes on her. ?This isn't the kind of
> > >>> show that address issue like that very well. ?I just want the revenge of
> > >>> the week. ?When the show is doing that it works when it strays from that
> > >>> formula it gets tedious.
> >
> > >> What toll?! Bitch Amanda hasn't *done* anything!! She wouldn't even kill
> > >> the guy who killed her father! She's such a wuss that she has basically
> > >> nothing to feel sorry for!!!
> >
> > >> This show has become an absolute joke, IMO - there's basically *no*
> > >> "revenge", and it's too milquetoast to even work as a nighttime sudser.
> >
> > >So does it only count as revenge if she kills people?
> >
> > Well, she did swear to kill the man who killed her father.
> >
> > But I think Ian would be satisfied to see some people go to prison or
> > simply get ruined, financially and socially. ?Well, I can't speak for him,
> > but I would.
> >
> > Point is, the shows steps farther ?away from the entire concept every
> > week. ?It's getting closer and closer to the continuous rolling,
> > unresolved plots of a true daytime soap opera.
>
> The show has no "edge".
> "NCIS:LA" has way more 'edge'.
>
> Let me say that again:
>
> NCIS:LA has MORE 'edge' than "Revenge".
>
> If that doesn't tell you everything you need to know in one simple
> sentence, I don't know what would.
>
> I can't think of a network show currently airing that has less 'edge'
> than "Revenge".
>
> That, in a nutshell, is everything that's wrong with the show:
>
> It's completely milquetoast.

I've watched ... maybe 2 or 3 NCISs. The pilot (guess that's 2) and the
recent crossover with Hawai'i 5.zero. Both were boring stupid crap.
There's an edge?

--
NETFLIX is befouling the ends of shows with text & graphics and shrinkage

Icebreaker

5/29/2012 7:19:00 PM

0


"anim8rFSK" <anim8rfsk@cox.net> wrote in message
news:anim8rfsk-7EA664.11360429052012@news.easynews.com...
> In article
> <7e4c239c-38c2-4c9b-bce7-7061ab1b409e@oo8g2000pbc.googlegroups.com>,
> "Ian J. Ball" <ijball@mac.com> wrote:
>
>> On May 29, 9:19 am, Mason Barge <masonba...@gmail.com> wrote:
>> > On Tue, 29 May 2012 09:44:01 -0600, suzeeq <su...@imbris.com> wrote:
>> > >Ian J. Ball wrote:
>> > >> In article <jq0ik5$ap...@dont-email.me>,
>> > >> Arthur Lipscomb <art...@alum.calberkeley.org> wrote:
>> >
>> > >>> [On "Revenge":]
>> > >>> I don't care about the toll it takes on her. This isn't the kind
>> > >>> of
>> > >>> show that address issue like that very well. I just want the
>> > >>> revenge of
>> > >>> the week. When the show is doing that it works when it strays from
>> > >>> that
>> > >>> formula it gets tedious.
>> >
>> > >> What toll?! Bitch Amanda hasn't *done* anything!! She wouldn't even
>> > >> kill
>> > >> the guy who killed her father! She's such a wuss that she has
>> > >> basically
>> > >> nothing to feel sorry for!!!
>> >
>> > >> This show has become an absolute joke, IMO - there's basically *no*
>> > >> "revenge", and it's too milquetoast to even work as a nighttime
>> > >> sudser.
>> >
>> > >So does it only count as revenge if she kills people?
>> >
>> > Well, she did swear to kill the man who killed her father.
>> >
>> > But I think Ian would be satisfied to see some people go to prison or
>> > simply get ruined, financially and socially. Well, I can't speak for
>> > him,
>> > but I would.
>> >
>> > Point is, the shows steps farther away from the entire concept every
>> > week. It's getting closer and closer to the continuous rolling,
>> > unresolved plots of a true daytime soap opera.
>>
>> The show has no "edge".
>> "NCIS:LA" has way more 'edge'.
>>
>> Let me say that again:
>>
>> NCIS:LA has MORE 'edge' than "Revenge".
>>
>> If that doesn't tell you everything you need to know in one simple
>> sentence, I don't know what would.
>>
>> I can't think of a network show currently airing that has less 'edge'
>> than "Revenge".
>>
>> That, in a nutshell, is everything that's wrong with the show:
>>
>> It's completely milquetoast.
>
> I've watched ... maybe 2 or 3 NCISs. The pilot (guess that's 2) and the
> recent crossover with Hawai'i 5.zero. Both were boring stupid crap.
> There's an edge?

One of the leads of NCIS LA offed an unarmed bad guy after some due
consideration and pleading from his partners to not do so in the season
finale. That qualifies as edge in anyone's book.