Skip to content

Instantly share code, notes, and snippets.

Avatar

Harlow Ward harlow

View GitHub Profile
@alexbaldwin
alexbaldwin / gist:5548993
Created May 9, 2013
Middleman Blog Twitter card integration
View gist:5548993
<% if current_article %>
<title><%= "#{current_article.title}" %></title>
<meta name="twitter:card" content="summary">
<meta property="twitter:creator" content="@alexbaldwin">
<meta name="twitter:title" content="<%= truncate(current_article.title, length: 70) %>">
<meta name="twitter:image" content="<%= "#{current_article.data.image}" %>">
<meta name="twitter:description" content="<%= truncate(strip_tags(current_article.summary), length: 200) %>">
<meta name="twitter:domain" content="<%= "http://www.alexbaldwin.com#{current_article.url}" %>">
<% else %>
@dhh
dhh / gist:1014971
Created Jun 8, 2011
Use concerns to keep your models manageable
View gist:1014971
# autoload concerns
module YourApp
class Application < Rails::Application
config.autoload_paths += %W(
#{config.root}/app/controllers/concerns
#{config.root}/app/models/concerns
)
end
end
You can’t perform that action at this time.