I am setting up an existing 'Ruby On Rails' project to my local Machine after database setup terminal command 'rails server' executes successfully but when I hit localhost:3000 in browser I get following response....
Started GET "/" for 127.0.0.1 at 2014-04-08 16:07:01 +0530
Processing by ContentController#index as HTML
RvClass Load (0.1ms) SELECT "rv_classes".* FROM "rv_classes"
Testimonial Load (0.2ms) SELECT "testimonials".* FROM "testimonials" WHERE "testimonials"."approved" = 't'
Setting Load (0.2ms) SELECT "settings".* FROM "settings" LIMIT 1
Completed 500 Internal Server Error in 1136ms
NoMethodError (undefined method `features' for nil:NilClass):
app/controllers/content_controller.rb:18:in `index'
content_controller.rb:
class ContentController < ApplicationController
layout "application"
before_filter :check_for_mobile, :except => [:inventory, :disclaimer, :preowned, :sunridge_rv_video]
before_filter :prepare_for_mobile, :only => [:inventory, :social_media ]
def inventory
end
def social_media
end
def index
@tweets = begin
Twitter.user_timeline("sunridgeRV").slice(0, 6)
rescue Twitter::Error
[]
end
@feature_products = Setting.first.features.where("product_id is not null")
@home_page_testimonials = Testimonial.where(:approved=>true).shuffle.take(3)
@setting = Setting.first
@products = Product.where(special_on_homepage: true)
end
def disclaimer
render :partial => 'disclaimer'
end
def preowned
render :partial => 'used_guarantee'
end
def sunridge_rv_video
@rv_class_brands = RvClassBrand.has_video_link
end
def sunridge_team
@team_members = TeamMember.order("department_id").order("id")
end
def sales_home
@setting = Setting.first
end
end