similar to: Find WHERE in Rails

Displaying 20 results from an estimated 15000 matches similar to: "Find WHERE in Rails"

2006 Apr 15
4
sql injection
Hi, All through my current project, I''ve been assuming that rails is clever enough to prevent SQL injections automatically. Is this right? If not, what''s the best way of doing it? -Nathan
2006 Feb 18
6
Why doesn''t my "action" take action?
I have the following code in my index.rhtml: <div id="how_many_images" style="background-color:#eee;"> <%= render(:partial => ''form'') %></div> ...and the following in my _form.rhtml <%= form_remote_tag(:update => "images_div_main", :url => { :action =>
2006 May 17
5
Today is "Rails Hates Me Day"
Has anybody had Rails just refuse to cooperate with anything? I had an application working great in development mode, then switched it over to production, tried to host it, but couldn''t. Some error that I can''t figure out. So I decided to create a simpler application, host THAT in little baby steps until something went wrong so I could tell maybe where I was losing it.
2006 Jul 05
2
splitting a paragraph into words and spaces
I''m using this: <% words = article.content.split(/ /) %> <%= words[0..20] %> to (ostensibly) split a paragraph into component words, with spaces in between, then print to html only the first 20 items, words and spaces. I got this (split(/ /)) from the online pickaxe book at http://rubycentral.com/book/ref_c_string.html#String.split . The problem is, the resulting array
2006 Apr 03
15
How should I pick a random entry from the database?
Hi guys. Total newbie here. I''ve been doing web stuff since 1996 but only began the foray into scripting last year. I haven''t got my skull completely 360 degrees around OOP yet. It''s just me here (in Japan) and there are no Ruby groups in my area (never mind any in English). I''ve got a database table - real simple: question, answer, and id fields - and I
2006 May 12
8
switching from development to production?
I think I''m missing a step here, but they don''t seem to cover this in the AWDWR book... does anybody know the various steps required to switch from development to production mode in Rails? I''ve scoured the application and changed everything that stands out, but the damn thing is still running off the development database and won''t connect to the production
2006 Apr 14
6
Running through results of find()
Hi, I''ve got a question about the find() method in RoR This is my code: actions=Action.find(:all, :conditions => "ActivityID=''actid''") This should return a list, array, hash, ... ? of Actions. What type of data does find() return? And how do I run through it? I would like to show Action.ActionCode for every action in actions. I tried: for action in
2006 Mar 09
15
regular expressions slay me
I am furiously trying to find what I am looking for in Pickaxe book and not finding it. I''m getting some values back from a posted form and I need to get the ''id'' number off the backend. The ''String'' will always come back to me as... Some_name\r\n123 where 123 is actually the id number which I need to execute the find. The reason they are coming back
2006 Mar 29
3
Loading records during class definition
I''ve created a look-up table in my database that currently has 4 rows. I want to access these as constants in the application because that''s effectively what they are. I tried this... class StockRuleLevel < ActiveRecord::Base has_many :stock_rules SITE = find(:first, :conditions => "type_code = ''site''").id MAKE
2006 Jan 27
17
Multiple Model Validation
Hey All ! I have a form which contains two models. I would like both models to be validated, but have their validations aggregated on the page. If I do: <%= error_messages_for(:model1) %> <%= error_messages_for(:model2) %> It puts two big validation blocks on the page. I would like all the errors from both models, but only in one validation box. Is this possible ? All my attempts
2006 Apr 06
2
how we can GET and POST values
hi all how we can do get and post value. i made one form and in this form their is two field loginname and password.and when i click on submit button than i t should verify from database and than the next page will arrive .how i can do that. how i can post value and than get it from that from and check .plese tell me yhis all in rubyon rails. hope for reply bye
2006 Mar 08
23
rubynuby == I''m a''scared to set it all up...
I''ve been mostly lurking here with an occasional nuby question for a few weeks now. It seems like Ruby and Rails and the many libraries and tools growing up around it are a remarkable toolset. Unfortunately I''m finding the whole enchilada a bit daunting. It seems that if one is to truly tap into the power of this thing and do a significant amount of developing, one needs
2006 Jun 08
7
How to make an OSX Finder in rails/AJAX?
I need to make a category browser that would allow nested categories. Is there any receipe on that? Currently, I use the :onchange event from one of the form element to update the first select (out of 4-5 selects), but I dont know how to elegantly reset all the child selects if I change the value from the first. All the categories are fetched from the DB and I would like a
2006 Mar 30
7
text_area
How to make that the typed code on ruby in text_area it was carried out in @params ["name"]?? -- Posted via http://www.ruby-forum.com/.
2006 Apr 15
7
New to rails - scaffold command , how to get related items?
Ahoy, I was able to follow the tutorials and build a simple to-do list program with Items and Categories and have the related tables link up w/ the default "scaffold :Items" command plus custom defenitions. Then I erased all of that and tried rebuilding the program using the ruby script/generate scaffold Item (and category) command. Now the templates look like " <% for
2006 Jul 13
10
Book Question on RoR
Hi there, I am a newbie and interested in learning Ruby on Rails. I see there are 2 books out there: Ruby for Rails Ruby techniques for Rails developers David A. Black and Agile Web Development with Rails : A Pragmatic Guide (Pragmatic Programmers) Dave Thomas, David Heinemeier Hansson, Andreas Schwarz, and Thomas Fuchs Which one should I get? "Agile Web Development with Rails"
2006 Jul 20
19
Recipes versus Ruby for Rails: what''s best after Agile?
For expats from other languages, what''s the next best step after the Agile Web Dev book: Rails Recipes or Ruby for Rails? Thanks, -- Austin -- Posted via http://www.ruby-forum.com/.
2006 Jan 05
13
Date Validation
Hi, How can I validate date in model class Thanks. Sainaba. -- Posted via http://www.ruby-forum.com/.
2006 Apr 09
16
Mapping to BigDecimals instead of Floats
Hi everyone, I''m new to Rails and Ruby, and have been working my way through the Pickaxe and Agile Rails books for the last week or so. With a background in payroll apps I found that the default ActiveRecord mapping of decimal columns to float variables really bothered me! Financial calcs need high levels of accuracy and floats just don''t give you that. I know there are a bunch
2006 Apr 06
8
Fastest learning path to RoR
hi! with a 4GL background, wanting to learn RoR, what is the fastest learning path i should take? should i go grab a RoR tutorial, and learn Ruby along the way, or start with plain Ruby first? thanks for any inputs!