Find_by_sql

Hi,

I am using
find_by_sql (“SELECT * FROM taxas WHERE taxon_id = ‘39’”) in controller.

Instead of ‘39’… I need to get variable from the user through
view.rhtml.

Kindly help me on this scripting.


With Regards
Palani Kannan. K
Office: +49-531-2616-226
Mobile: +4917647098166

Hi,

You can pass the variable as params to your controller .

Regards,
Amit K.

On Sep 8, 12:08 pm, PalaniKannan K [email protected] wrote:

Hi,

I am using
find_by_sql (“SELECT * FROM taxas WHERE taxon_id = ‘39’”) in controller.

Instead of ‘39’… I need to get variable from the user through view.rhtml.

There’s no reason to use find_by_sql here - a regular find with
conditions or a dynamic finder (find_by_taxon_id) should be fine.

Fred

Hi Amit,

Thank you for reply, I dont know the method to apply params, kinldy give
me
some tutorial to apply params and modifications in controller, model and
view for applying param. I am a new bee.

Hi Frederick,

Thank you for reply, when i use find_by_taxon_id, I am unable to apply
it
directly with constant and i need to apply through param. I dnt know the
method to apply param. If you know the method to apply param in this
case
kindly give me tutorial or reference which for modifications in
controller,
model and view. I am a new bee.

On 8 September 2010 13:16, Frederick C.
[email protected]wrote:

Office: +49-531-2616-226
http://groups.google.com/group/rubyonrails-talk?hl=en.


With Regards
Palani Kannan. K
Office: +49-531-2616-226
Mobile: +4917647098166

Please got through this tutorial
http://www.tutorialspoint.com/ruby/index.htm

Regards,
Amit K.

Great!

Hi,

Thanks to both Amit and Frederick, It works…

On 8 September 2010 13:44, Amit K. [email protected] wrote:

model and view. I am a new bee.

controller.

To unsubscribe from this group, send email to
Palani Kannan. K
For more options, visit this group at
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.


With Regards
Palani Kannan. K
Office: +49-531-2616-226
Mobile: +4917647098166

Hi brito,

I used “find” by the way mr.Frederick adviced. i never used params in
sql
sentence. thank you for your intimation.
On 8 September 2010 17:50, radhames brito [email protected] wrote:

Amit K.

Hi Frederick,

Office: +49-531-2616-226
For more options, visit this group at

You received this message because you are subscribed to the Google G.
You received this message because you are subscribed to the Google G.
You received this message because you are subscribed to the Google G.
“Ruby on Rails: Talk” group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected][email protected]
.
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.


With Regards
Palani Kannan. K
Office: +49-531-2616-226
Mobile: +4917647098166

one note never pass the params hash to a sql sentence NEVER.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs