Skip to content

Instantly share code, notes, and snippets.

@ssaunier
Created May 10, 2012 09:42
Show Gist options
  • Save ssaunier/2652169 to your computer and use it in GitHub Desktop.
Save ssaunier/2652169 to your computer and use it in GitHub Desktop.
Generate a Rails controller in namespace /api/v1
#! /bin/sh
if [ $# -eq 0 ]; then
echo "Usage: ./generate_api_controller.sh CONTROLLER"
exit 1
fi
bundle exec rails generate controller "api/v1/$1" --no_helper --no_assets
rm -rf app/views/api
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment