This file contains 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
require "csv" | |
namespace :extract_hoge do | |
desc 'Data extraction' | |
task extraction: :environment do | |
p 'start task' | |
hoges = Hoge.all.order(id: :asc) | |
CSV.open('path/to/hoge.csv','w') do |row| | |
hoges.each do |hoge| | |
row << [ hoge.id, hoge.name, hoge.tel ] if hoge.tel.present? |
This file contains 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
git branch --merged | grep -v "\*" | grep -v master | grep -v dev | xargs -n 1 git branch -d |
This file contains 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
<%= link_to hoge_path(hoge.path, hoge.path) do %> | |
<i class="hoge-class"></i><%= hoge.name %> | |
<% end %> |
This file contains 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
git config --global alias.st status | |
git config --global alias.co checkout | |
git config --global alias.br branch | |
git config --global alias.cm commit | |
git config --global alias.fc fetch | |
git config --global alias.df diff | |
git config --global alias.gr grep |
This file contains 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
git config --global user.name "Your Name" | |
git config --global user.email you@example.com |
This file contains 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 send_email_to_user | |
email_params = { | |
subject: params[:subject], | |
to_email: params[:to_email], | |
from_email: params[:from_email], | |
description: params[:description],} | |
HogeMailer.send_email_to_user(email_params) | |
render :nothing => true | |
end |
This file contains 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
$(document).ready(function(){ | |
$('.jsInputOnClickFocus').focus(function(){ | |
$(this).select(); | |
}); | |
}); |
This file contains 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
<%= f.select :hoge_type, options_for_select(Hoge::TYPE_HASH.invert), { include_blank: '選択してください' }, { class: 'test', required: true } %> | |
<%= select_tag :hoge_type, options_from_collection_for_select(Hoge::TYPE_HASH.invert, :first, :last), { :include_blank => '選択してください' } %> |
This file contains 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
// ex) test_type = 'テスト1' | |
[select* test_type include_blank default:get "テスト1" "テスト2" "テスト3" "テスト4" "テスト5(test)"] |
OlderNewer