- Run
npm install cordova-res --save-dev
- Create
1024x1024px
icon atresources/icon.png
- Create
2732x2732px
splash atresources/splash.png
- Add
"resources": "cordova-res ios && cordova-res android && node scripts/resources.js"
toscripts
inpackage.json
- Copy
resources.js
file toscripts/resources.js
- Run
sudo chmod -R 777 scripts/resources.js
- Run
npm run resources
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
# Rails concern that tracks and purges cache keys to avoid using Rails.cache.delete_matched since its very costly on Redis. | |
# | |
# @countries = Country.query_cached('countries:index', "limit:#{@limit}", "offset:#{@offset}") do | |
# query.limit(@limit).offset(@offset).all.to_a | |
# end | |
module Cacheable | |
extend ActiveSupport::Concern | |
included do | |
before_save :purge_cache |
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
<%= form.hidden_field field, data: { quill: { target: "input" } } %> | |
<div style="min-height:500px;" data-quill-target="editor" data-action="click->quill#focus"></div> |
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
def current_ability | |
@current_ability ||= begin | |
current_ability = Ability.new(current_user) | |
controller_names.to_a.each do |controller_name| | |
model_name = controller_name.classify | |
model_ability = "#{model_name}Ability".constantize rescue nil | |
if model_ability.present? && model_abilities[model_ability].nil? | |
model_abilities[model_ability] = model_ability.new(current_user) | |
current_ability.merge(model_abilities[model_ability]) | |
end |
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
<div class="form-group"> | |
<%= form.label :type, "Type", class: "font-weight-bold" %> | |
<%= form.select :type, ['TextQuestion', 'UrlQuestion'], { include_blank: true }, { class: "form-control", data: { action: "input->toggle#changed", target: "toggle.select" } } %> | |
</div> | |
<div class="form-group"> | |
<%= form.label :name, "Name", class: "font-weight-bold" %> | |
<%= form.text_field :name, class: "form-control" %> | |
</div> | |
<div class="form-group" data-target="toggle.element" data-values="UrlQuestion"> | |
<%= form.label :url, "URL", class: "font-weight-bold" %> |