save_and_open_page
have_button(locator)| #!/usr/bin/env ruby | |
| # ### README #### | |
| # | |
| # Check if the river is updating and alert if not | |
| # | |
| # gem install elasticsearch | |
| # gem install couchrest | |
| # |
| <% [:notice, :error, :alert].each do |level| %> | |
| <% unless flash[level].blank? %> | |
| <div class="alert-message <%= flash_class(level) %>"> | |
| <a class="close" href="#">×</a> | |
| <%= content_tag :p, flash[level] %> | |
| </div> | |
| <% end %> | |
| <% end %> |
| # db/migrate/XXXXXXXXXXXXX_add_authentication_token_to_users.rb | |
| class AddAuthenticationTokenToUsers < ActiveRecord::Migration | |
| def change | |
| add_column :users, :authentication_token, :string | |
| add_index :users, :authentication_token, :unique => true | |
| end | |
| end |
| // In this example we detect if a user clicks a link to travel elsewhere | |
| // but has made changes to a form. If they have changed the form it prompts | |
| // them to confirm before continuing. | |
| jQuery(function ($) { | |
| var $form = $('form').watchChanges(); | |
| $('a').click(function (e) { | |
| if ($form.hasChanged() and ! confirm('Continue without saving changes?')) { | |
| e.preventDefault(); | |
| } |
| # Nginx+Unicorn best-practices congifuration guide. Now with SPDY! | |
| # We use latest stable nginx with fresh **openssl**, **zlib** and **pcre** dependencies. | |
| # Some extra handy modules to use: --with-http_stub_status_module --with-http_gzip_static_module | |
| # | |
| # Deployment structure | |
| # | |
| # SERVER: | |
| # /etc/init.d/nginx (1. nginx) | |
| # /home/app/public_html/app_production/current (Capistrano directory) | |
| # |
| # app/controllers/users/password_controller.rb | |
| class Users::PasswordsController < Devise::PasswordsController | |
| def resource_params | |
| params.require(:user).permit(:email, :password, :password_confirmation) | |
| end | |
| private :resource_params | |
| end |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!-- | |
| Licensed to the Apache Software Foundation (ASF) under one or more | |
| contributor license agreements. See the NOTICE file distributed with | |
| this work for additional information regarding copyright ownership. | |
| The ASF licenses this file to You under the Apache License, Version 2.0 | |
| (the "License"); you may not use this file except in compliance with | |
| the License. You may obtain a copy of the License at | |
| http://www.apache.org/licenses/LICENSE-2.0 |
| git update-index --assume-unchanged <path&filename> |