$ echo 'gem "webpacker"' >> Gemfile
$ bundle install
$ rails webpacker:install
$ yarn add [email protected] jquery popper.js
diff --git a/config/webpack/environment.js b/config/webpack/environment.js
index d16d9af..86bf1a7 100644
module ActionController | |
class Metal | |
attr_internal :cached_content_for | |
end | |
module Caching | |
module Actions | |
def _save_fragment(name, options) | |
return unless caching_allowed? |
## Ryanair.com FE Developer Tests | |
Choose 1 of the following web apps below, build it and submit it to [email protected] with the subject "Developer Test Web App". ZIP files or public Github URLs will be accepted. | |
Provide any build commands or runtime requirements (webserver required, extra packages, environment variables) in an INSTALLATION.txt file at the root of the project. The goal is to have the application as easily deployable as possible. | |
You may use a responsive framework (Foundation, Bootstrap) if you like, but customising the CSS (or SASS) will get you extra kudos. You must use AngularJS as the Javascript framework. | |
### Cheap flight finder |
GFORCE => git add -A && git commit --amend -C HEAD && git push -f | |
c => git_index | |
cbg => git rev-parse --verify HEAD | simple_clipboard | |
g => git | |
ga => git_add_shortcuts | |
gaa => git add -A | |
gap => git add -p | |
gash => git stash | |
gasha => git stash apply | |
gashl => git stash list |
version: 2 | |
jobs: | |
build: | |
environment: | |
working_directory: ~/circleci-myapp | |
docker: | |
- image: circleci/ruby:2.4.2-node-browsers | |
environment: | |
CC_TEST_REPORTER_ID: XXXYYY | |
RAILS_ENV: test |
require 'rubygems' | |
require 'capybara' | |
require 'capybara/dsl' | |
Capybara.run_server = false | |
Capybara.current_driver = :selenium | |
Capybara.app_host = 'http://www.google.com' | |
module MyCapybaraTest | |
class Test |
$ echo 'gem "webpacker"' >> Gemfile
$ bundle install
$ rails webpacker:install
$ yarn add [email protected] jquery popper.js
diff --git a/config/webpack/environment.js b/config/webpack/environment.js
index d16d9af..86bf1a7 100644
http://stackoverflow.com/questions/22667401/postgres-json-data-type-rails-query | |
http://stackoverflow.com/questions/40702813/query-on-postgres-json-array-field-in-rails | |
#payload: [{"kind"=>"person"}] | |
Segment.where("payload @> ?", [{kind: "person"}].to_json) | |
#data: {"interest"=>["music", "movies", "programming"]} | |
Segment.where("data @> ?", {"interest": ["music", "movies", "programming"]}.to_json) | |
Segment.where("data #>> '{interest, 1}' = 'movies' ") | |
Segment.where("jsonb_array_length(data->'interest') > 1") |
# Ruby CircleCI 2.0 configuration file | |
# | |
# Check https://circleci.com/docs/2.0/language-ruby/ for more details | |
# | |
defaults: &defaults | |
working_directory: ~/repo | |
docker: | |
- image: circleci/ruby:2.4.1-node-browsers | |
environment: |
# in your view (HAML + simple_form, simplified for easier reading) | |
= simple_form_for @bp_reading do |f| | |
= f.input :recorded_at, :as => :string, :input_html => { :class => 'jquery-ui-date', :value => @bp_reading.try(:recorded_at).try(:strftime,'%m/%d/%Y')} | |
= f.input :recorded_at, :as => :hidden, :input_html => { :id => 'recorded-at-alt'} | |
= f.button :submit, :disable_with => "Saving...", :value => "Save" | |
# in your javascript (coffeescript) | |
$ -> | |
$(".jquery-ui-date").datepicker( | |
altField: "#recorded-at-alt", |
if defined?(ActiveRecord::Base) && defined?(Authlogic) | |
controller = ApplicationController.new | |
require 'action_controller/test_case' | |
controller.instance_variable_set(:@_request, ActionController::TestRequest.new) | |
controller.instance_variable_set(:@_response, ActionController::TestResponse.new) | |
Authlogic::Session::Base.controller = Authlogic::ControllerAdapters::RailsAdapter.new(controller) | |
end | |
UserSession.new( User.first ) |