forked from ryanb/nifty-generators
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make a namespaced resource to default to not namespace the model. The
model can be namespaced with --namespace-model.
- Loading branch information
Douglas Meyer
committed
Jan 1, 2011
1 parent
ed7f3f4
commit 7dabe27
Showing
20 changed files
with
130 additions
and
58 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
def destroy | ||
@<%= instance_name %> = <%= class_name %>.find(params[:id]) | ||
@<%= instance_name %>.destroy | ||
flash[:notice] = "Successfully destroyed <%= model_name.underscore.humanize.downcase %>." | ||
redirect_to <%= items_path('url') %> | ||
flash[:notice] = "Successfully destroyed <%= class_name.underscore.humanize.downcase %>." | ||
redirect_to <%= items_url %> | ||
end |
This file contains 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
This file contains 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
2 changes: 1 addition & 1 deletion
2
lib/generators/nifty/scaffold/templates/tests/rspec/actions/destroy.rb
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
it "destroy action should destroy model and redirect to index action" do | ||
<%= instance_name %> = <%= class_name %>.first | ||
delete :destroy, :id => <%= instance_name %> | ||
response.should redirect_to(<%= items_path('url') %>) | ||
response.should redirect_to(<%= items_url %>) | ||
<%= class_name %>.exists?(<%= instance_name %>.id).should be_false | ||
end |
This file contains 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
2 changes: 1 addition & 1 deletion
2
lib/generators/nifty/scaffold/templates/tests/testunit/actions/destroy.rb
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
def test_destroy | ||
<%= instance_name %> = <%= class_name %>.first | ||
delete :destroy, :id => <%= instance_name %> | ||
assert_redirected_to <%= items_path('url') %> | ||
assert_redirected_to <%= items_url %> | ||
assert !<%= class_name %>.exists?(<%= instance_name %>.id) | ||
end |
2 changes: 1 addition & 1 deletion
2
lib/generators/nifty/scaffold/templates/views/erb/_form.html.erb
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
2 changes: 1 addition & 1 deletion
2
lib/generators/nifty/scaffold/templates/views/haml/_form.html.haml
This file contains 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
This file contains 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
Oops, something went wrong.