/ Published in: Rails
in Rails 2, use `include ActionController::UrlWriter` instead.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
include Rails.application.routes.url_helpers # set host in default_url_options: default_url_options[:host] = "localhost" # can then use: url_for() # can check existing routes: edit_user_url(User.first) => "http://localhost/user/1/edit"