Skip to content

Instantly share code, notes, and snippets.

@dreamr
Created February 3, 2010 17:11
Show Gist options
  • Save dreamr/293785 to your computer and use it in GitHub Desktop.
Save dreamr/293785 to your computer and use it in GitHub Desktop.
can you make it
def rest_actions
@rest_actions = DreamResourceGenerator.rest_actions unless @rest_actions.empty?
@rest_actions
end
That also means the:
class <%= plural_name.capitalize %>Controller < ApplicationController
<% action = <<-EOS
# GET /#{plural_name}
# GET /#{plural_name}.xml
def index
@#{plural_name} = #{singular_name.capitalize}.all
respond_to do |format|
format.html # index.html.haml
format.xml { render :xml => @#{plural_name} }
end
end
EOS
-%>
<%= action if rest_actions.include?(":index") -%>
^^ notice this
do to all in controller and controller_spec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment