Skip to content

Instantly share code, notes, and snippets.

seiyamaeda seiyamaeda

Block or report user

Report or block seiyamaeda

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@seiyamaeda
seiyamaeda / Gemfille
Last active Apr 3, 2018
Post a message to 'alert' channel in Slack
View Gemfille
gem 'json'
gem 'faye-websocket'
gem 'eventmachine'
gem 'slack-ruby-client'
@seiyamaeda
seiyamaeda / app|controllers|hoges_controller.rb
Last active Apr 3, 2018
Creating text-date, Convert Time Class to String Class
View app|controllers|hoges_controller.rb
class HogesController < ApplicationController
private
def get_date_text
from = params[:from]
to = params[:to]
wave_dash_text = ' ~ '
get_converted_string_date(from) + wave_dash_text + get_converted_string_date(to)
View app|controllers|concerns|bool_castable.rb
module Concerns
module BoolCastable
extend ActiveSupport::Concern
private
def cast_to_boolean(value)
ActiveRecord::Type::Boolean.new.cast(value)
end
end
@seiyamaeda
seiyamaeda / app|assets|javascripts|application.js
Created Apr 3, 2018
How to use TimePicker in AdminLTE ver2 (with Bootstrap 3.3.6)
View app|assets|javascripts|application.js
:
:
//= require admin-lte/plugins/timepicker/bootstrap-timepicker.min
@seiyamaeda
seiyamaeda / app|assets|javascripts|application.js
Last active Apr 3, 2018
How to use DatePicker in AdminLTE ver2 (with Bootstrap 3.3.6)
View app|assets|javascripts|application.js
:
:
//= require admin-lte/plugins/datepicker/bootstrap-datepicker
//= require admin-lte/plugins/datepicker/locales/bootstrap-datepicker.ja
@seiyamaeda
seiyamaeda / Gemfile
Last active Apr 3, 2018
How to use 'Cocoon' | Ruby on Rails 5.1.4 | AdminLTE ver2 (with Bootstrap 3.3.6) | Model 'Hoge' and 'Model 'Fuga' are 'one-to-many relationship'
View Gemfile
gem 'cocoon'
gem 'jquery-rails'
@seiyamaeda
seiyamaeda / app|assets|javascripts|hoge.coffee
Last active Apr 2, 2018
How to make the disabled-link with CoffeeScript / for Ruby on Rails 5.1.4
View app|assets|javascripts|hoge.coffee
$(document).on 'turbolinks:load', ->
do ->
$('.disabled-link').click (e) ->
e.preventDefault()
return
@seiyamaeda
seiyamaeda / Gemfile
Last active Mar 31, 2018
Kaminari on 'Ruby on Rails 5.1.4'
View Gemfile
gem 'kaminari'
@seiyamaeda
seiyamaeda / app|views|hoges|new.html.slim
Last active Mar 29, 2018
Open modal view on AdminLTE ver2 (with Bootstrap 3.3.6)
View app|views|hoges|new.html.slim
/ the way it uses font awesome
= link_to '#', data: { toggle: 'modal', target: '#hoge-modal' } do
i.fa.fa-question-circle
end
== render partial: 'layouts/shared/modals/hoge'
@seiyamaeda
seiyamaeda / CLI
Last active Apr 6, 2018
Update select box when another one is updated. / E.g. Hoge and Fuga are 'one-to-many relationship', and use a controller 'Piyo' without this association .
View CLI
$ ruby -v
ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]
$ bundle exec rails -v
Rails 5.1.4
You can’t perform that action at this time.