Skip to content

Instantly share code, notes, and snippets.

View jdmorlan's full-sized avatar

Jay Morlan jdmorlan

  • Freelance Web Developer
  • Houston, TX
View GitHub Profile
@jwo
jwo / example-action.js
Created August 22, 2016 21:27
Getting React and Redux React and Rails and Fetch and Safari to play nice.
export function saveOfficeStaff(section, staff) {
return (dispatch, getState) => {
const issue = getState().newsletterId;
const theData = {
staff: staff,
section_id: section.id
}
fetch(`/api/newsletters/${issue}/office_staff`, {
@jwo
jwo / action.html.erb
Last active April 19, 2020 21:31
register React component on page with turbolinks working. The Rails parts (helper and ERB) are optional, but since this IS turbolinks, you probably ARE using rails.
<h1>Oh Hai</h1>
<%= react_component 'oh-hai' %>
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=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')