Created
January 25, 2012 05:18
-
-
Save eccyan/1674880 to your computer and use it in GitHub Desktop.
Railsでデプロイ環境に合わせてrobots.txtを出力するコントローラ ref: http://qiita.com/items/1876
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RobotsController < ApplicationController | |
def index | |
render_text = File.read "#{::Rails.root}/public/robots.#{::Rails.env}.txt" | |
respond_to do |format| | |
format.text { render :text => render_text, :layout => false } | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment