I'm going to spend some of my easter vacation learning ruby on rails. I've encountered a problem with my routing. I hope you can help me with this.
What I'm trying to do is set my controller index in namespace home as the root (the controller I want to use when I hit the root of my website). Note that my controller is called index and the method I want to use is also called index.
Here is the structure of my controller(s):
app
-controllers
-home
-index_controller.rb
My index_controller.rb looks like this:
class Home::IndexController < ApplicationController
def index
@testing = 1
end
end
My routes.rb file looks like this:
MyFirstRail::Application.routes.draw do
namespace :home do
get "/" => "index#index"
end
end
I had a look at this question - but I couldn't make it work.
I'm using rails 3 and Rubymine as IDE (if it's any help).