モデル内で_pathとか_urlとかでURLを作成する
config/routes.rb
------------------------------------------------------------------
Rememo::Application.routes.draw do
match "user/:id", :controller => "user", :action => :index, :as => :user
end
------------------------------------------------------------------
config/environments/production.rb
------------------------------------------------------------------
Rails.application.routes.default_url_options[:host]= 'rememo.jb-jk.net'
------------------------------------------------------------------
app/models/user.rb
------------------------------------------------------------------
class User < ActiveRecord::Base
def profile_url
Rails.application.routes.url_helpers.user_url(self.id)
end
end
------------------------------------------------------------------