Loading ...
Sorry, an error occurred while loading the content.

Re: [puneruby] Unidentified Url Problem

Expand Messages
  • C. K. Ponnappa
    Puneet, I suspect your problem lies in the way you staging server is set up. What server are you using? You say it isn t mongrel so that leaves just a small
    Message 1 of 5 , Nov 1, 2008
    View Source
    • 0 Attachment
      Puneet, I suspect your problem lies in the way you staging server is set up.

      What server are you using? You say it isn't mongrel so that leaves just
      a small set of possibilities - apache+fcgi, lighttpd+fcgi or phusion
      pasenger perhaps? (I'm assuming your staging runs some flavour of Linux).

      Let me know what server setup you're using and we can take it from there.

      Best,
      Sidu.
      http://blog.sidu.in

      Aman King wrote:
      >
      > I've never seen such a problem before. It'd be interesting to know
      > what causes such a thing.
      >
      > However to get your site working in the meanwhile, why don't you go
      > back to using url_for() to generate your links instead of "named
      > routes" ("restful routes" are a different thing, not what you're
      > referring to here).
      >
      > Eg:
      > <%= link_to 'Home', url_for(:controller => 'users', :action => 'home',
      > :user => current_user.username) %>
      >
      > Note that your routes.rb can remain the same (as long as the default
      > route map.connect ':controller/:action/:id' is at the bottom).
      >
      > That should solve your problem for the moment.
      >
      > Regards,
      >
      > Aman King
      > http://www.wikyblog.com/AmanKing <http://www.wikyblog.com/AmanKing>
      >
      > 2008/10/27 Puneet Pandey <puneet_pandey85@...
      > <mailto:puneet_pandey85%40yahoo.co.in>>:
      > > Hello Guys,
      > >
      > > Hope you all are well and doing good. I am stuck in one problem,
      > hope anyone
      > > has the solution of it. Below I m describing my issue.
      > >
      > > I am using restful for my application. like once the user is logged
      > in and
      > > is in his home page the route I m using is:
      > >
      > > map.home ':user/home', :controller => 'users', :action => 'home'
      > > so it is giving me the output such as
      > http://localhost:3000/puneet/home <http://localhost:3000/puneet/home>
      > >
      > > This and many more routes are working prefectly fine on localhost,
      > but when
      > > I tried to upload this code into the staging, it is giving me some
      > strange
      > > url like http://mongrel/puneet/home <http://mongrel/puneet/home>
      > (whenever I clicked on links), whereas
      > > it should give me this http://mysitename.com/puneet/home.
      > <http://mysitename.com/puneet/home.>
      > >
      > > I don't have mongrel server on staging. I have also tried to install
      > mongrel
      > > but no success i got. So later I un-installed it. Someone told me to
      > assign
      > > a variable in routes.rb
      > > so at the bottom of routes.rb I added this line
      > > SITE_URL = "mysitename.com"
      > >
      > > Now when I try to send this url with each and every action
      > specifically on
      > > link_to tag I got this
      > >
      > > -> mysitename.comhttp://mongrel/puneet/home
      > <mysitename.comhttp://mongrel/puneet/home>
      > >
      > > I tried various method like:
      > > (1) <%= link_to 'Home', "#{SITE_URL}" +
      > home_path(current_user.username) %>
      > > but no solution :-(
      > >
      > > I just want to replace mongrel with the actual name of my site. This has
      > > already taken many days of mine. Hope you guys would be able to show
      > me the
      > > right way.
      > >
      > > Waiting for your Responses,
      > > Puneet Pandey
      > > ROR DEVELOPER
      >
      >
    • Sandip Ransing
      Hi How you can declare SITE_URL in routes.rb. It should be in environments.rb Let me know what i am thinking right or wrong ? Thanks, Sandip ... Sandip Ransing
      Message 2 of 5 , Nov 2, 2008
      View Source
      • 0 Attachment
        Hi

        How you can declare SITE_URL in routes.rb.

        It should be in environments.rb

        Let me know what i am thinking right or wrong ?

        Thanks,
        Sandip
        ...
        Sandip Ransing Ruby On Rails Developer
        (M)+919860648108
             

        --- On Sun, 2/11/08, C. K. Ponnappa <ckponnappa@...> wrote:
        From: C. K. Ponnappa <ckponnappa@...>
        Subject: Re: [puneruby] Unidentified Url Problem
        To: puneruby@yahoogroups.com
        Date: Sunday, 2 November, 2008, 3:16 AM











        Puneet, I suspect your problem lies in the way you staging server is set up.



        What server are you using? You say it isn't mongrel so that leaves just

        a small set of possibilities - apache+fcgi, lighttpd+fcgi or phusion

        pasenger perhaps? (I'm assuming your staging runs some flavour of Linux).



        Let me know what server setup you're using and we can take it from there.



        Best,

        Sidu.

        http://blog. sidu.in



        Aman King wrote:

        >

        > I've never seen such a problem before. It'd be interesting to know

        > what causes such a thing.

        >

        > However to get your site working in the meanwhile, why don't you go

        > back to using url_for() to generate your links instead of "named

        > routes" ("restful routes" are a different thing, not what you're

        > referring to here).

        >

        > Eg:

        > <%= link_to 'Home', url_for(:controller => 'users', :action => 'home',

        > :user => current_user. username) %>

        >

        > Note that your routes.rb can remain the same (as long as the default

        > route map.connect ':controller/ :action/: id' is at the bottom).

        >

        > That should solve your problem for the moment.

        >

        > Regards,

        >

        > Aman King

        > http://www.wikyblog .com/AmanKing <http://www.wikyblog .com/AmanKing>

        >

        > 2008/10/27 Puneet Pandey <puneet_pandey85@ yahoo.co. in

        > <mailto:puneet_ pandey85% 40yahoo.co. in>>:

        > > Hello Guys,

        > >

        > > Hope you all are well and doing good. I am stuck in one problem,

        > hope anyone

        > > has the solution of it. Below I m describing my issue.

        > >

        > > I am using restful for my application. like once the user is logged

        > in and

        > > is in his home page the route I m using is:

        > >

        > > map.home ':user/home' , :controller => 'users', :action => 'home'

        > > so it is giving me the output such as

        > http://localhost: 3000/puneet/ home <http://localhost: 3000/puneet/ home>

        > >

        > > This and many more routes are working prefectly fine on localhost,

        > but when

        > > I tried to upload this code into the staging, it is giving me some

        > strange

        > > url like http://mongrel/ puneet/home <http://mongrel/ puneet/home>

        > (whenever I clicked on links), whereas

        > > it should give me this http://mysitename. com/puneet/ home.

        > <http://mysitename. com/puneet/ home.>

        > >

        > > I don't have mongrel server on staging. I have also tried to install

        > mongrel

        > > but no success i got. So later I un-installed it. Someone told me to

        > assign

        > > a variable in routes.rb

        > > so at the bottom of routes.rb I added this line

        > > SITE_URL = "mysitename. com"

        > >

        > > Now when I try to send this url with each and every action

        > specifically on

        > > link_to tag I got this

        > >

        > > -> mysitename.comhttp: //mongrel/ puneet/home

        > <mysitename.comhttp: //mongrel/ puneet/home>

        > >

        > > I tried various method like:

        > > (1) <%= link_to 'Home', "#{SITE_URL} " +

        > home_path(current_ user.username) %>

        > > but no solution :-(

        > >

        > > I just want to replace mongrel with the actual name of my site. This has

        > > already taken many days of mine. Hope you guys would be able to show

        > me the

        > > right way.

        > >

        > > Waiting for your Responses,

        > > Puneet Pandey

        > > ROR DEVELOPER

        >

        >

























        Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/

        [Non-text portions of this message have been removed]
      • Puneet Pandey
        Hello Aman, Ponnappa and Sandip, First of all thank you to all of you, for suggesting the ways, I have resolved that problem. here is my solution : I told you
        Message 3 of 5 , Nov 3, 2008
        View Source
        • 0 Attachment
          Hello Aman, Ponnappa and Sandip,

          First of all thank you to all of you, for suggesting the ways, I have resolved that problem. here is my solution :

          I told you that I have defined SITE_URL = "mysitename.com" in routes.rb, After couple of discussions and putting my mind into it, I have changed it to:

          SITE_URL = "http://mysitename.com"

          Then wherever I have used url, like home_url, profile_url etc etc, I have changed it to url_path so it will take the exact path of it, then I concatinated my SITE_URL with the url_path in order to get the exact url string, I did like this :

          <%= link_to "Profile", SITE_URL + profile_path(current_user.username) %>
          and It solved my problem..

          Once again thank you to all of you for your responses, Hope this thing should help someone in future :)

          Thanks, Puneet Pandey


















          Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/invite/

          [Non-text portions of this message have been removed]
        Your message has been successfully submitted and would be delivered to recipients shortly.