<% if params[:controller] == 'news' && params[:action] == 'show' %> <% news = News.find(params[:id]) %> <%= render(:partial => 'like/news/content', :locals => { :news => news }) %> <% elsif params[:controller] == 'messages' && params[:action] == 'show' %> <% message = Message.find(params[:id]) %> <%= render(:partial => 'like/topic', :locals => { :topic => message }) %> <% elsif params[:controller] == 'wiki' && (params[:action] == 'show' || params[:action] == 'index') %> <% page = project.wiki.find_page(params[:action] == 'show' ? params[:id] : params[:page]) %> <% if page %> <%= render(:partial => 'like/wiki', :locals => { :project => project, :page => page }) %> <% end %> <% end %>