[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Problem running simple rail application

Vikas Gholap

12/23/2008 7:22:00 AM

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

1. F:\RubyProjects>rails chapterone

2. F:\RubyProjects\chapterone>rails script/generate controller
greeting

3. after that i edit greeting_controller.rb

class GreetingController < ApplicationController
def index
@welcome_message="Welcome to your first rail application"
end
end


4. then i create a index.html.rb file in app/view/greeting folder

<html>
<body>
<h1><%=@welcome_message %></h1>
</body>
</html>

5. 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 Gholap.
--
Posted via http://www.ruby-....

5 Answers

Yaser Sulaiman

12/23/2008 8:01:00 AM

0

[Note: parts of this message were removed to make it a legal post.]

On Tue, Dec 23, 2008 at 10:22 AM, Vikas Gholap <vikasg@aflatune.com> wrote:
>
> 4. 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 Sulaiman

[0] http://www.ruby-forum.c...

Dejan Dimic

12/23/2008 8:14:00 AM

0

On Dec 23, 8:22 am, Vikas Gholap <vik...@aflatune.com> wrote:
> 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
>
> 1.  F:\RubyProjects>rails chapterone
>
> 2. F:\RubyProjects\chapterone>rails script/generate controller
> greeting
>
> 3. after that  i edit greeting_controller.rb
>
> class GreetingController < ApplicationController
>        def index
>                @welcome_message="Welcome to your first rail application"
>        end
> end
>
> 4. then i create a index.html.rb file in app/view/greeting folder
>
> <html>
> <body>
> <h1><%=@welcome_message %></h1>
> </body>
> </html>
>
> 5. 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 Gholap.
> --
> Posted viahttp://www.ruby-....

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 Gholap

12/26/2008 7:25:00 AM

0

Thanks Dejan Dimic

I solve my problem.
>> Vikas Gholap.


--
Posted via http://www.ruby-....

Vikas Gholap

12/26/2008 7:33:00 AM

0

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.
1) created rails application by

projects>rails ShoppingCart

2) then created database for shopping cart table-products

fields are- id, title, description, price, expiredate

3) 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.

5) 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
--
Posted via http://www.ruby-....

Vikas Gholap

12/26/2008 7:34:00 AM

0

Thanks, Dejan Dimic.

but new query arise to me
Below is my query,



I am trying to develop simple shoppingcart application.
1) created rails application by

projects>rails ShoppingCart

2) then created database for shopping cart table-products

fields are- id, title, description, price, expiredate

3) 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.

5) 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

--
Posted via http://www.ruby-....