render_views # If called within a describe, context, or whole spec will allow to use:
expect(response.body).to have_content "..."
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
#!/usr/bin/env ruby | |
if `grep -rls --include "*.rb" --include "*.js" "debugger" .` != "" | |
puts "A debugger statement was found, remove before committing." | |
exit(1) | |
end | |
if `grep -rls --include "*.rb" "binding.pry" .` != "" | |
puts "A pry statement was found, remove before committing." | |
exit(1) |
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
Pry.commands.alias_command 'c', 'continue' | |
Pry.commands.alias_command 's', 'step' | |
Pry.commands.alias_command 'n', 'next' |
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
// Place your key bindings in this file to overwrite the defaultsauto[] | |
[ | |
{ | |
"key": "shift+cmd+down", | |
"command": "editor.action.moveLinesDownAction", | |
"when": "editorTextFocus" | |
}, | |
{ | |
"key": "ctrl+cmd+down", | |
"command": "-editor.action.moveLinesDownAction", |
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
class RegistrationsController < Devise::RegistrationsController | |
def create | |
super do | |
resource.add_role(:moderator) | |
resource.save | |
end | |
end | |
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
# POST /resource | |
def create | |
build_resource(sign_up_params) | |
resource.save | |
yield resource if block_given? | |
if resource.persisted? | |
if resource.active_for_authentication? | |
set_flash_message :notice, :signed_up if is_flashing_format? | |
sign_up(resource_name, resource) |