ฉันต้องการเปลี่ยนเส้นทางไปยัง index.html ในโฟลเดอร์ application/public ของฉัน
def get_current_user
@current_user = current_user
if @current_user.nil?
redirect_to root_path
end
end
ฉันจะบรรลุเป้าหมายนี้ได้อย่างไร?
ฉันยังไม่ได้แก้ไขรูทในเส้นทางของฉัน (มันยังคงแสดงความคิดเห็น)
# root :to => "welcome#index"
ฉันได้รับข้อผิดพลาดแจ้งว่า root_path ไม่ได้ถูกกำหนดไว้
ฉันจะแก้ไข Routes.rb เพื่อให้ root_path ชี้ไปที่ public/index.html ได้อย่างไร
root_path
ให้ใช้redirect_to '/'
- person meagar   schedule 07.06.2011