[Rails] save image from url to blob

2010-02-12 Thread Frank_in_Tennessee
Hello, I would like to save jpg images from urls similar to the one below to a field defined as a blob, but I am not sure how to code it. img src=http://images.mywebsite.com/5f52f047f131d.jpg; alt=image 15943-0 / Is this how it should be coded if the url was extracted? image_file = Image.new

[Rails] Model not found in custom script...

2010-02-10 Thread Frank_in_Tennessee
Hello, I have a custom task_scheduler.rb file in RAILS_ROOT/configuration/ initializers. It fails because I think that it doesn't know where to find my Category model. Do you know how I can load or have available the resources/environment that myrails app uses into this script? Thanks, Frank

[Rails] Define a string as a Model object

2010-02-05 Thread Frank_in_Tennessee
Good morning, I'm trying to dynamically define models. This method #1 works: model_name = User @Model = model_name @Model.find(params[:id]).name This method #2 doesn't: model_name = User @Model = model_name @Model.find(params[:id]).name Anyone know how I can get method #2 to work? Is there

[Rails] Re: Define a string as a Model object

2010-02-05 Thread Frank_in_Tennessee
Works great now. Thank you. Modified Code: model_name = User @Model = model_name.constantize @Model.find(params[:id]).name On Feb 5, 10:32 am, Marnen Laibow-Koser li...@ruby-forum.com wrote: Frank_in_Tennessee wrote: Good morning, I'm trying to dynamically define models. This method

[Rails] acts_as_audited - save NAME value not ID value

2010-02-03 Thread Frank_in_Tennessee
I have a form with many fields that can be changed. Company, Group, Facility, Department, User, etc... Each field has an associated table with the following fields(ID, NAME) If a Company, Group, or Department is changed, the 'CHANGES' text field of the 'AUDITS' table stores something like the

[Rails] run 'script/generate controller' from inside app

2010-01-30 Thread Frank_in_Tennessee
Is it possible to run generator commands from within a running rails application? I'm experimenting with creating an application that can create 'views' on the fly. In my 'pages_controller.rb' I have the following code: # Run Ruby script to create all pages defined in 'website_pages.txt'

[Rails] Re: run 'script/generate controller' from inside app

2010-01-30 Thread Frank_in_Tennessee
I appreciate everyones feedback. I will experiment with all suggestions. Thank you, Frank -- You received this message because you are subscribed to the Google Groups Ruby on Rails: Talk group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this