Forum: Ruby on Rails problems with view_paths

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ralph H. (Guest)
on 2008-12-04 18:27
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!!!!!!!!!!!!!!!!!!!!!!!!!
This topic is locked and can not be replied to.