To Examples
PageWithImage Directions
- Open a command window.
- Navigate to your rails applications folder.
- Create a new rails project named PageWithImage:
> rails new PageWithImage
- Navigate to the PageWithImage folder.
- Create a new rails controller and view:
> rails generate controller ShowImage mypage
or
> rails g controller ShowImage mypage
- Copy this image to the folder
PageWithImage/app/assets/images
- Replace the contents of the file
PageWithImage/app/views/show_image/mypage.html.erb with
mypage.html.erb
- Start the Rails server:
> rails server
or
> rails s
- In a browser navigage to this URL:
> http://localhost:3000/show_image/mypage