Link to home
Start Free TrialLog in
Avatar of jwright9
jwright9

asked on

How do I add a new view page (web page) to my Ruby on Rails applicartion?

I have created a ruby on rails applications using scaffolding.  It runs fine.  I want to add a new view page to my application by hand but I am having no luck so far.  I added a reference to the page in routes.rb and added an entry in the controller.  I am not real familiar with this aspect of rails.

The entry in the route.db looks like this:

Msp1::Application.routes.draw do
  resources :businesses
match 'manage' => 'businesses#manage'
  # The priority is based upon order of creation:
  # first created -> highest priority.

  # Sample of regular route:
  #   match 'products/:id' => 'catalog#view'
  # Keep in mind you can assign values other than :controller and :action

The entry in my controller:
def manage
    @businesses = Business.all

    respond_to do |format|
      format.html # manage.html.erb
      format.xml  { render :xml => @businesses }
    end
  end

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of JESii
JESii
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jwright9
jwright9

ASKER

JESii,  Do you know of any good tutorials that show you the programmer how to add routes, views, etc. to an existing RoR project?
Sure; check this out - http://www.engineyard.com/blog/2010/the-lowdown-on-routes-in-rails-3/

And thanks for the points!