search for: ramblingsonrail

Displaying 13 results from an estimated 13 matches for "ramblingsonrail".

Did you mean: ramblingsonrails
2009 Apr 13
4
Creating Methods in the Model?
Hey Everyone. First day diving in to ROR and Ruby... My question is how do you define methods with in the model class and/or should I even be doing this? It is my understanding that you should put as much of the business logic into the model as possible. I want to do some data manipulation before I things are submitted to the database IE (Create a variable out of two submitted via form, as
2009 May 22
2
using console is a proper way in produciton?
Hello. I''ve planned to use script/console to support mainloop for my rails application. I need some infinite loop for doing my logic. For example, I want to give a point every second to users. to do this task I think I simply code like this: loop { GivePoint(); sleep 1 } on script/console and handle taks in the GivePoint method. Can this way work fine on commercial application? In fact,
2009 Jun 02
1
406 Not Acceptable response
I want to send a response in a content type that is not listed in the request Accept header. When I try to do this in Rails a response of status code 406 Not Acceptable is sent. I would like to know how to do this. Ps: A example of a API that do this is the Sun Cloud API, where the errors are sent in a specific media type (http://kenai.com/projects/
2009 Jun 18
2
How to persist file upload fields after a validation error.
Hi all, Is there an easy way to not lose the file field input from the user after a validation error? It pisses people off to have to choose their files again just because some other field didn''t pass a validation. I''ve googled this and just haven''t come up with much of anything. Thanks.
2009 Jun 19
1
config.action_controller.session_store = :active_record_store
Hi All, I am new to Rails and learning rails reading ebook ''Agile web development using rails''. I am doing samples given in this book chapter by chapter. but I stuck when I come to Sessions chapter, they have given that to enable session to be Database based the line config.action_controller.session_store = :active_record_store is to be uncommented from config/environment.rb
2009 Apr 29
1
Driving me nuts!!! - Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
I had to put a new HD in, and now I''m reinstalling everything, and can''t get mysql to fully work. I can''t remember how I fixed it. I''ve searched everywhere online and can''t find anything. when I try to use the >mysql command I get this: Can''t connect to local MySQL server through socket ''/tmp/ mysql.sock'' (2) My first
2009 May 13
4
Setting flash notice via javascript?
I am using a javascript to redirect to another action. Is there a way to set the flash [:notice] in the javascript? So when the javascript redirects, the new action/view picks up the flash[:notice]? (I suspect I may have to do something like url?notice=.....) ideas? thanks.
2009 Apr 09
4
create_table with unique combo
I need to create a table replacing default integer id with a string id and making a combo of (id and version) unique primary key. Here is what I''ve got so far. class CreateCatalogs < ActiveRecord::Migration def self.up create_table :catalogs, :id => false do |t| t.string :id, :limit => 20, :null => false t.string :version, :default =>
2009 Jan 23
3
Bug regarding ActiveRecord and TimeWithZone
I''ve discovered a strange behavior regarding ActiveRecord and TimeWithZone I''ve seen the error when using SQL Server, I have not yet tried with any other database. Here''s output from the console - "User" is a simple model made with a migration. ----------------------------------------- >> d1 = User.find(:first).created_at => Thu, 21 Jun 2001
2009 Apr 07
5
strategies for securing attachment files from unwanted access
Hi, we are developing an app for a company and their data has to be private. There will be different stakeholders with different roles accesing the application and there will be lots of attachments. We are using paperclip to upload attachments, which are stored in the filesystem within the public directory. Right now, the image_tags are only rendered if you are logged in and your role allows
2009 Feb 19
8
validate for street
Hallo all, can someone tell me what can be the regulare expression for this: "The Road", "The Road 12", "Road", "On the Road 89". -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this
2009 Jan 26
5
Please help with a routing problem
Hi All I''m having some issues with the following routes problem. The routes.rb file ... map.resources :users map.connect ''/users/view_payments/:user_id'', :controller => ''users'', :action => ''view_payments'' The users_controller.rb file ... def view_payments @user = User.find[:params[:user_id]] @payments =
2009 Aug 21
12
What to do before launching v1.0?
I’m launching a rails website, the app is written and works, undoubtedly it’ll be an unmitigated disaster when I launch but none the less I thought I’d least attempt to give myself the best chance of success by asking all the gurus here for some advice – pre launch advice if you like. In an ideal world I’d spend days and hours on all of these things and get it absolutely spot on, but as we all