This file contains hidden or 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
// This way you can change the buttons color with a simple `background-color` setting | |
// without need to regenerate the whole gradient | |
input[type=button], input[type=submit], button | |
font-family: Arial, Helvetica | |
color: #333 | |
border: 1px solid #ccc | |
border-radius: .25em | |
text-shadow: 0 1px 1px rgba(0,0,0,.3) |
This file contains hidden or 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
# | |
# RJS handler was kicked out of Rails 3.1 along with Prototype | |
# so, here is a little substitute coz we use it here and there | |
# | |
# Just save it in some file in the `config/initializers` | |
# | |
module ActionView | |
module Template::Handlers | |
class RJS | |
# Default format used by RJS. |
This file contains hidden or 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 hidden or 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
# | |
# This function takes messy Word HTML pasted into a WYSIWYG and cleans it up | |
# It leaves the tags and attributes specified in the params | |
# Copyright (c) 2009, Radio New Zealand | |
# Released under the MIT license | |
require 'rubygems' | |
require 'sanitize' | |
def clean_up_word_html(html, elements = ['p', 'b', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6'], attributes={}) |
NewerOlder