Yes, Im new to Ruby. COming from PHP/Java world. I DON’T want to learn
ruby, sigh.
Anyway I got a project that is done in ruby and it need some
modifications sometimes.
So until now, dont know how, I managed fixing a few things on that
application.
Sometimes was about setting a page to show more fields than before. Or
maybe block a page redirecting it to an access denied page.
But now things are gotting more serious and bigger modifications are
needed. I think I can manage doing that. But working like have done
until now is VERY unefficient. Basically, Im working directly on a
test server. I NEVER managed (this is the real big problem) in
installing the app, correctly, on my local machine. Im getting mad in
trying to do it it but with no success.
Thus the problem is about succesing in making the local app working.
Explaining in details everything I guess would make most of you stop
reading this post. So I try with another strategy. Here it comes:
I am on MAC. Ruby is installed by default. I MUST use Apache as
server. So I put a virtual host poiting to /MY_PATH_RO_ROR_APP/public
When typing http://localhost/ then I see the content of the public
folder.
The APP is “empty”. Im not using things like generate or scaffolding.
Why? Well, because my thought was to just copy all the application
located on the test-server and making it work. Is that bad? I dont
know. I would prefer not to go through all ruby stuff.
If it is bad it is ok, as long as this is not the cause of the thing
that the app is not working.
What I need to do is to create a controller manually and connect it
through the route.rb.
i create a file in the app folder named product_controller.rb:
class ProductController < ApplicationController
def show
render :text => ‘abcd’
return
end
end
Now I want to map the route. How can I do this? I tried different
ways. For example:
map.resources :product
or
map.connect ‘:controller/:action/:id’
or
map.connect ‘:controller/:action/:id.:format’
or
map.connect ‘:product/:show’
Well, everytime I try then to type something in the browser. I try for
example:
localhost/product/1
localhost/product/show
localhost/product/1/show
localhost/product
Well, all the time I can see the same error in the log:
File doesnt exist.
Right now Im thinking that the url-requests are managed by apache. And
that apache doesnt understand that this is a ROR app? Is that the
problem maybe??? And does anyone know how to make apache understand
that that one is a ruby app??