Hello i''m trying do add view paths to my project
In my local machine it is working fine but when i''m trying to host my
project it is not working i don''t understand why?
I''m using rails 2.0.2
This is my controller
class FrontEndController < ApplicationController
before_filter :get_site
before_filter :add_view_path
def site
@site ||= get_site
end
protected
def add_view_path
#logger.info self.class.view_paths.inspect
self.prepend_view_path("#{RAILS_ROOT}/app/views/#{site.inner_name}")
#logger.info self.class.view_paths.inspect
end
def get_site
@site = Site.find_by_name(request.domain) || Site.find(1)
end
end
This is my model
class Site < ActiveRecord::Base
def inner_name
name.gsub(/[^a-zA-Z0-9]/, '''')
end
end
can someone tell me why this code is working in my local machine and it
is not working when i''m trying to host my project
PLEASE HELP!!!!!!!!!!!!!!!!!!!!!!!!!
--
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 group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---