Created
February 3, 2010 17:11
-
-
Save dreamr/293785 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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