In the view of html.erb.
<%= time_ago_in_words(m.created_at) %> ago
<%= time_ago_in_words(m.created_at) %> ago
map.root :controller => 'posts'
ActionController::Routing::Routes.draw do |map|
map.resources :posts
end
class Post < ActiveRecord::Base
validates_presence_of :name, :crews
def to_param
"#{id}-#{name.gsub(/\s/,'_').downcase.gsub(/\?/,'')}"}"
end
end
<%= link_to post.title, post_path(post) %> // With Routing
<%= link_to post.title, :action => 'show', :id => 'post' %> // Without Routing