Skip to content

Instantly share code, notes, and snippets.

@aalvarado
Last active December 19, 2015 20:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aalvarado/6011560 to your computer and use it in GitHub Desktop.
Save aalvarado/6011560 to your computer and use it in GitHub Desktop.
before_filter :find_position, only: [:show, :destroy, :edit]
def destroy
if @position.destroy
flash[:success] = t('labels.success')
else
flash[:error] = t('labels.error')
end
redirect_to positions_path
end
def position_params
params.require(:position).permit(:id)
end
def find_position
@position = Position.find(position_params)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment