I have an html homepage that I created along with some CSS and JS code. I want to include this to my ruby application as a homepage. In my config/routes.rb I have this:
# You can have the root of your site routed with "root"
# just remember to delete public/index.html.
# root :to => 'welcome#index'
root :to => 'first_controller#index', :as => 'first_controller'
and in my first_controller I have this:
class FirstControllerController < ApplicationController
def index
@users = User.all
end
end
Can I create a def home method that redirects to my html file?
The @users = User.all is code from a book im reading, that teaches you how to build a ruby app, that I modify along hte way to my needs.
thx
You could do
Also, since it is plain html, you could make rails cache it. Add
caches_page :homein your controllerEdit: formatting