What besides the fact that overloading home_url is not a good idea concerns you about using a route? What about using app_url as a route?
The APP_URL as it is just does not work in my case with the prefix. Setting it to http://localhost/ce/ lead to urls that contained the prefix twice - I forget where, but it was in one of the response emails. On Jun 16, 4:35 am, Bruno <[email protected]> wrote: > Hmm... I checked out your branch, and tests do pass (but I think > there's pretty poor coverage when it comes to something like APP_URL). > I'm also in favor of removing it, but I'm not sure using a route (esp. > home_url) is the best way. home_url really refers to the home page of > the site, which in CE's default state is base_controller#site_index. > > But someone might want to change the home page to be something else, > and still use home_url throughout the site to point there. Imaging if > someone wanted home_url to point to users/index. Then all the places > where we were using APP_URL would break. > > Any other ideas? > > On Jun 15, 2:54 pm, Bruno Bornsztein <[email protected]> > wrote: > > > Yes, please issue a pull request so I can check this out and make sure it > > passes the tests.Take care, > > Bruno > > > On Fri, Jun 12, 2009 at 3:29 PM, moritz <[email protected]> wrote: > > > > I had the need to run CE with a prefixed URL, so instead of > > >http://localhost/ > > > usinghttp://localhost/ce/byspecifying > > > ActionController::Base.relative_url_root. > > > > There were a few locations in the CE code base that needed changing. > > > > For example (for a more complete set of changes see the GitHub > > > repository mentioned below): > > > > ./app/views/base/_about_nav.html.haml > > > %a{:href=>"/faq"}= :frequently_asked_questions.l > > > %a{:href=>"/about"}=:about_site.l(:site => > > > AppConfig.community_name) > > > %a{:href=>"/advertise"} > > > ... > > > > ./app/views/admin/users.html.haml > > > - form_tag '/admin/users', :class => 'MainForm' do > > > ./app/views/users/forgot_password.html.haml > > > - form_tag '/forgot_password', :class => 'MainForm' do > > > ./app/views/users/forgot_username.html.haml > > > - form_tag '/forgot_username', :class => 'MainForm' do > > > ./app/views/users/resend_activation.html.haml > > > - form_tag '/resend_activation', :class => 'MainForm' do > > > ... > > > > ... and APP_URL references. > > > > I have created a fork at GitHub and made changes to the edge branch > > > (seehttp://github.com/a5sk4s/communityengine/tree/edge). > > > > Generally, I replaced APP_URL with home_url, removing some '/'s as > > > well, except for > > > > ./app/models/user_notifier.rb > > > ActionMailer::Base.default_url_options[:host] = APP_URL.sub > > > ('http://', '') > > > ./community_engine_setup_template.rb > > > environment "\nAPP_URL = \"http://localhost:3000\"", :env => env > > > environment "\nAPP_URL = \"http://#{app_url}\"", :env => > > > 'production' > > > > which I left as they were. I'm not sure where > > > ActionMailer::Base.default_url_options[:host] is used or what the > > > changes in community_engine_setup_template.rb need to be. I would > > > like to aim at eliminating APP_URL all together. > > > > All link references where replaced by the corresponding route urls, so > > > for example '/' with home_url, '/faq' with faq_url, and '/ > > > forgot_password' with forgot_password_url. > > > > I ran rake community_engine:test, but can't really test it right now > > > as for the necessary setup. > > > > The other thing that I noticed, but haven't changed yet is that the > > > google site search cof value contains > > > > S:http://#{APP_URL} > > > > which expands to > > > > S:http://http://localhost/ > > > > I believe that this needs to be S:#{APP_URL} (or better: S:# > > > {home_url}). > > > > Please review and let me know if you are interested in moving this > > > back into the edge code base. Do I send you a pull_request? - never > > > done it. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CommunityEngine" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/communityengine?hl=en -~----------~----~----~----~------~----~------~--~---
