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
Spree::Admin::ProductsController.class_eval do | |
set_callback :load_collection, :after, :show_nothing | |
private | |
def show_nothing | |
@collection = @collection.where '0=1' | |
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
# Usage: bundle exec cap staging execute:rake task=db:migrate | |
namespace :execute do | |
task :rake do | |
on roles(:all) do | |
within release_path do | |
with rails_env: fetch(:rails_env) do | |
execute :bundle, "exec rake #{ENV['task']}" | |
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
network.host: 127.0.0.1 | |
http.host: 127.0.0.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
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |
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
def Organizer(c)=c.select{_1=~/^(?!tom)\w{5}/} | |
# Modify the solution above. Emojis are free. | |
# Code below will check correctness. | |
example_collection = [ | |
'apples', | |
33, | |
nil, | |
'hat', | |
'tomatoes', |
OlderNewer