Here's a guide on how to setup a new rails app on shared hosting.
1. Create a new Rails app via SSH If you don't have SSH access you will need to fill out a support ticket with HostNine to gain access.
A) Move into your home directory. (If you just logged in, you are already there.)
ln -s ../myapp/public myapp
D) Let the server know about your Rails application. Open up the file located at myapp/public/.htaccess. You can access this over FTP or using the nano or vi commands over SSH. This file shouldn't already exist in the system. If it does, you can empty it's contents. Put this as the entire contents of the file:
E) From here you will create your needed models, controllers, and views for your application. Models are the objects, which will usually be linked to a table in your database. A model can be created used the following command:
rails generate model User
F-1) A controller is what moves data between the model (database) and your view. A controller can be created using the following code.
rails generate controller User
F-2) The view is where you will control what the user sees. The view can either be created manually or with help of the generator.
rails generate controller User list
2. Configure your database.yml (for database connections)We are using mysql in this example
3. Create your first model (this will also generate your migration file)Pay attention to capitalization and singularity
script/generate model User
4. Edit the migration for this mode
class CreateUsers < ActiveRecord::Migration
create_table "users", :force => true do |t|
t.column :login, :string
t.column :email, :string
t.column :created_at, :datetime
t.column :updated_at, :datetime
5. Attempt to migrate your code (create the tables in the database
6. Now create your first controller
You can also predefine the list action. This will create the necessary view as well
script/generate controller user
script/generate controller user list
7. Now set the user controller and list action as your default action. First remove public/index.html
Uncomment the map.root line in routes.rb
# You can have the root of your site routed with map.root -- just remember to delete public/index.html.
map.root :controller => "user", :action => "list
# See how all your routes lay out with "rake routes"
# Install the default routes as the lowest priority.
8. You should be all set, now go learn Rails!