search for: presdemoi

Displaying 2 results from an estimated 2 matches for "presdemoi".

2008 Dec 13
1
need to initialize contant arrays , where to do it...
...p..) ALL_DOMAINS = Domain.find(:all).map { |d| d.name }.compact I tried to write it in an initialize or in my application.rb BUT problem : when I run a rake db:migrate initially (after creating the database) I get an error.. rake db:migrate --trace (in /Users/yves/Developpement/Projects/rails/presdemoi) ** Invoke db:migrate (first_time) ** Invoke environment (first_time) ** Execute environment rake aborted! Mysql::Error: Table ''yves_pdm_dev.domains'' doesn''t exist: SELECT * FROM `domains` right, the table is not yet created, that''s why I want to do a migrate .....
2007 Dec 22
8
Rails 2.0 rescue_from
I am trying to use the new Rails 2.0 macro : rescue_from class PostsController < ApplicationController rescue_from ActiveRecord::RecordNotFound, :with => :deny_access ... def show @post = Post.find_by_id(params[:id]) raise ActiveRecord::RecordNotFound if @post.nil? #illegal access ..... end def deny_access respond_to do |format| format.html end end but the