vikas
December 23, 2008, 8:30am
1
Hello to all , please Give me solution…
I am new in ruby development, so please me, i am asking a very simple
query.
Problem :
I created a simple greeting application
F:\RubyProjects>rails chapterone
F:\RubyProjects\chapterone>rails script/generate controller
greeting
after that i edit greeting_controller.rb
class GreetingController < ApplicationController
def index
@welcome_message=“Welcome to your first rail application”
end
end
then i create a index.html.rb file in app/view/greeting folder
<%=@welcome_message %>
then i open browser http:\localhost:3000/greeting
here i got a error
MissingSourceFile in GreetingController#index
So can any one suggest me , how to get out of this error.
Thank you,
Vikas G…
vikas
December 23, 2008, 9:10am
2
On Tue, Dec 23, 2008 at 10:22 AM, Vikas G. [email protected]
wrote:
then i create a index.html.rb file in app/view/greeting folder
I think the file extension is causing the problem. Try to change it to
.html.erb.
Don’t forget to post your future Rails question on the Ruby on Rails
forum[0].
Regards,
Yaser S.
[0] http://www.ruby-forum.com/forum/3
vikas
December 23, 2008, 9:16am
3
On Dec 23, 8:22 am, Vikas G. [email protected] wrote:
greeting
MissingSourceFile in GreetingController#index
So can any one suggest me , how to get out of this error.
Thank you,
Vikas G…
Posted viahttp://www.ruby-forum.com/.
I have repeat your steps exactly as you presented them and everything
is working fine as expected, unlike in your case.
There is something missing in your presentation.
You have to give us more details to be able to help you with this
unexpected behavior.
vikas
December 26, 2008, 8:33am
5
Thanks Yaser , problem solved by changing file extension.
but new query arise to me
Below is my query,
I am trying to develop simple shoppingcart application.
created rails application by
projects>rails ShoppingCart
then created database for shopping cart table-products
fields are- id, title, description, price, expiredate
created one Product scaffold by
projects>ShoppingCart>ruby script/generate scaffold Product title:string
description:text price:decimal expiredate:datetime
4)then i browse and did some new, edit, delete operations.
Now i want to add one field to my products table- image_url.
then fields are- id, title, description, price, expiredate, image_url.
I want to overwrite Product sacffold so that when i browse products page
it should display me added field i.e image_url.
give me steps to solve this problem.
Is there any migration related issue?
Vikas
vikas
December 26, 2008, 8:34am
6
Thanks, Dejan D…
but new query arise to me
Below is my query,
I am trying to develop simple shoppingcart application.
created rails application by
projects>rails ShoppingCart
then created database for shopping cart table-products
fields are- id, title, description, price, expiredate
created one Product scaffold by
projects>ShoppingCart>ruby script/generate scaffold Product title:string
description:text price:decimal expiredate:datetime
4)then i browse and did some new, edit, delete operations.
Now i want to add one field to my products table- image_url.
then fields are- id, title, description, price, expiredate, image_url.
I want to overwrite Product sacffold so that when i browse products page
it should display me added field i.e image_url.
give me steps to solve this problem.
Is there any migration related issue?
Vikas