# Bed Rails Console . application . helper.number _ to_currency( 10 ) . helper.number _ to_percentage( 42, accuracy: 2) . . User.where( created_at: 10. days.ago. Time.now)
# IRB Console . sort_options=[:id, :title, :author] . # type= sort_options. consist of?( params[:sort] )? params [:sort]:: id . # type=( sort_options. consist of?( params(* )) & & params[:sort] )| | . :params presence_in( sort_options) |> |>. : id . . 1 < => > 2[:sort] #= > -1 . 10 < = > 2 # => > 1 . 10 < = > 10 # => > 0(* ) . . cash= 9.5 . "%.2 f" % cash( *) #= > "9.50" ( *) . . % w { . a b} # = > . % i {a b} ( *) #= > . . year= 1972 . instance year . when 1970. .1979: "Seventies" . when 1980..1989:" Eighties" . when 1990. .1999: " Nineties" . end # Terminal < . rails g version remark individual: belongs_to body: message- p . . rails log: clear . . tail- f log/development. log <|grep DEBUG . . resemble' treasure:-- no-document' > > ~ / . gemrc . . EDITOR= code package open < GEMNAME > . EDITOR= code treasure open < GEMNAME > . . package out-of-date["a", "b"] # models/profile. rb . course Account < ApplicationRecord . belongs_to: individual . . delegate: e-mail, to:: individual . [:a, :b] # def e-mail
. # user.email
. # end . end . . # profile.email # ~/. railsrc . -- skip-spring .-- no-helper
.-- < no-assets .-- no-controller-specs . -- no-view-specs # application_controller. rb . course ApplicationController < ActionController:: Base . def user_signed_in? . #! current_user. nil? .!! current_user . end . end # Terminal
. thread include stimulation # app/javascript/packs/ application.js . import' controllers' # app/javascript/controllers/ index.js( * ) . import {Application} from" stimulation" . import {definitionsFromContext} . from" stimulus/webpack-helpers" . . const application= Application.start() . const context = require.context(" controllers", real,/. js$/) . application.load( definitionsFromContext( context)) # app/javascript/controllers/ hello/world _ controller.js . import {Controller} from" stimulation" . . export default course expands Controller { . boot up() { . console.log(" HELLO GLOBE") . } . <}
# Sight . < div data-controller=" hello there-- globes">>
RELATED ARTICLES