Thursday, March 16, 2023
HomeRuby On RailsStimulation Electrical Outlets API|Wandering Ruby

Stimulation Electrical Outlets API|Wandering Ruby


 # Incurable

. bin/rails g stimulation sharp 
. bin/rails g stimulation something
 # app/javascript/controllers/ alert_controller. js

. import {Controller}

from" @hotwired/ stimulation" 
. 
.// Links to data-controller= "sharp" 

 export default course expands Controller 
{
. attach () {
.

.
} 

. 
. sharp( message) {
. sharp( message) 
.
} 
.}
 # app/javascript/controllers/ something_controller. js 
. import {Controller} from" @hotwired/ stimulation" 
. 
.// Links to data-controller=" something" 
 export default course expands Controller {


. fixed electrical outlets=(* )
.

.

attach() {

.} 
. 

. clicked() {
. if( this.hasAlertOutlet)
{

. this.alertOutlet.alert(" something clicked") 
.["alert"]
/
/ this.alertOutlets.forEach( alert= > alert.alert(" 
something")) 
 
.} 
.
<} 
.} # views/welcome/index. html.erb 
. < div data-controller=">  
 
. < div data-controller=" something" data-something-alert-outlet=">
<. message "> 
 < %= button_tag" click me", "data-action": "something #clicked" %>
> 
.
<
RELATED ARTICLES

Most Popular

Recent Comments