views:

92

answers:

3

Hey guys, new to rails, but I have found out how to create an app now through the shell but to create an app using rails appname would give me a url of http://url.com/appname/ but I want my app, to be within the route if you understand me, so it's just http://url.com/login/ or /signup or /play so on?

So does anyone have any ideas how to do this, or why you can't or I shouldn't? Anything really, thanks guys!

A: 

It depends on your hosting provider, with dreamhost, which I use, its part of the tools they provide to configure where do I want the application to be.

If you have to configure things yourself, you can still write your alias configuration or whatever your server uses to map to your rails application public/ folder.

Francisco Soto
How or where do I configure this, I "used" hosting rails. but as of now I am locally, learning / developing.
Chris Leah
Since you are locally, how are you using your domain?
Francisco Soto
Because this was something I noticed before I cancelled my hosting. And I was curious as to how I could or will come about the solution when I make the site LIVE again. Thanks.
Chris Leah
A: 

Rails application is stored in some directory like appname but it doesn't appear in url path. In general you should configure your server (Apache, nginx, ...) to point to public folder in rails application. The only thing to do is to configure your server properly.

klew
Ah, I must not of configured it properly, because I have seen the AppName in the URL when testing LIVE, I would have to go through App name. I suppose I must configure, routes etcetera, am I right?
Chris Leah
Rails routes are for "inner" part of your url. If your root is `www.example.com` then Rails routes are for urls like `www.example.com/users` etc. If your root url is like `www.example.com/myapp` then routes are used for `www.example.com/myapp/users` etc.
klew
+1  A: 

if you use passenger and apache, firstly in your apache conf file

<VirtualHost *:80>
  ServerName myapp.local
  DocumentRoot "/home/davit/myapp/public"
</VirtualHost>

DocumentRoot should be point to your app' s public folder.

And in public folder create a .htaccess file and write this:

PassengerEnabled on
RailsEnv development
davit