RailsCasts Pro episodes are now free!
Learn more or hide this
<% if admin? %> <%= link_to 'New Episode', new_episode_path %> <% end %>
helper_method :admin? protected def admin? false end def authorize unless admin? flash[:error] = "unauthorized access" redirect_to home_path false end end
before_filter :authorize, :except => :index