目次
いろいろ
rails routes Model.where(conditions).exists?
Rails 6にjQueryとBootstrapを入れる
update
brew upgrade ruby-build rbenv install -l rbenv install 3.0.0 rbenv local 3.0.0
バージョン確認
rbenv versions ruby -v gem -v rails -v psql -v heroku --version git --version
vimgrepの使い方
ディレクトリを再帰的に検索
:vim 検索文字 app/** | cw :vim 検索文字 app/controller/** | cw
カレントバッファを対象にする
:vim 検索文字 %
NERDTreeの使い方
Homebrewのインストール rbenvのインストール
gemのインストール先 例えばbootstrap 環境によって違う
~/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/bootstrap-sass-3.4.1/assets/stylesheets/bootstrap
Node.jsのインストール
brew install nodebrew
nodebrew -v nodebrew 1.0.1 Example: # install nodebrew install v8.9.4 # use a specific version number nodebrew use v8.9.4
mkdir -p ~/.nodebrew/src
nodebrew install stable
nodebrew ls v14.4.0 current: none
nodebrew use 14.4.0 use v14.4.0
nodebrew ls v14.4.0 current: v14.4.0
echo 'export PATH=$HOME/.nodebrew/current/bin:$PATH' >> ~/.zprofile
source ~/.zprofile
node -v v14.4.0
vim-plug
.vimrc
Plug 'neoclide/coc.nvim', {'branch': 'release'}
インストール
:PlugInstall
:CocInstall coc-solargraph Installed extension coc-solargraph@1.1.6 at /Users/jq/.config/coc/extensions/node_modules/coc-solargraph
touch ~/.vim/coc-settings.json
{ "languageserver": { "sorbet": { "command": "srb", "args": ["tc", "--typed", "true", "--enable-all-experimental-lsp-features", "--lsp", "--disable-watchman", "--dir", "."], "filetypes": ["ruby"], "rootPatterns": ["sorbet/config"], "initializationOptions": {}, "settings": {} } } }
Solargraph gem not found. Run `gem install solargraph` or update your Gemfile., Install Now? (y/n)
gem install solargraph
rails postgres
rails _6.0.3_ new tepnote -d postgresql
表示切り替え
<label class="control-label" for="search"></label> <select class="form-control" name="search"> <option value="">何を検索しますか?</option> <option value="house_notes">家備考</option> <option value="personal_notes">個人備考</option> </select>
<script type="text/javascript"> $(function(){
$('select[name="search"]').change(function() { if ($('select[name="search"] option:selected').val() == 'house_notes') $('#house_notes').css('display','block'); else $('#house_notes').css('display','none');
if ($('select[name="search"] option:selected').val() == 'personal_notes') $('#personal_notes').css('display','block'); else $('#personal_notes').css('display','none'); });
}); </script>