You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 19, 2018. It is now read-only.
get '/(*other)', to: 'hyperloop#app', which introduce in Chapter 7, should mention in Chapter 1, other, rails route not worked, I do this myself when follow this tuto, but others maybe not.
after rails g hyperloop:install, and then copy application_record.rb into app/hyperloop/models, that not work, uninitialized constant ApplicationRecord, the solution is: add config.import 'models/application_record' into config/initializers/hyperloop.rb, and rm tmp/cache, then worked.
this step is done in this project, but when follow tuto, no where told us.
Follow is some advice for hyperloop
Following usage i think is error-prone. EditItem(todo: params.todo).on(:save, :cancel) { mutate.editing false }
In most case, :save, :cancel should be browser internal event,
If we use a event like this but name conflict with this, what happen?
and, use param to define a event is very strange for me.
I think a better idea is: (two selection)
Not use on method, not conflict with browser event, you just hope yield
one behavior only, use a name other than on is better, or, just simple:
# replace EditItem(todo: params.todo).on(:save, :cancel) { mutate.editing false }# withEditItem(todo: params.todo,on_save: proc{mutate.editingfalse},on_cancel: proc{mutate.editingfalse})# and invoke it like this:params.on_save.call
Not use param to declare a event. e.g.
defevent(name)# detect all browser internal support event name, if conflict, raise a error.paramname,type: Procendevent:on_save
I think first solution is better, because params.on_save is just like usual param,
it just use logic instead of a variable.
The text was updated successfully, but these errors were encountered:
Following just the summarize discuss in gitter:
Following is toto error:
get '/(*other)', to: 'hyperloop#app', which introduce in Chapter 7, should mention in Chapter 1, other, rails route not worked, I do this myself when follow this tuto, but others maybe not.
after rails g hyperloop:install, and then copy application_record.rb into app/hyperloop/models, that not work,
uninitialized constant ApplicationRecord
, the solution is: addconfig.import 'models/application_record'
intoconfig/initializers/hyperloop.rb
, and rm tmp/cache, then worked.this step is done in this project, but when follow tuto, no where told us.
Follow is some advice for hyperloop
Following usage i think is error-prone.
EditItem(todo: params.todo).on(:save, :cancel) { mutate.editing false }
In most case,
:save
,:cancel
should be browser internal event,If we use a event like this but name conflict with this, what happen?
and, use
param
to define a event is very strange for me.I think a better idea is: (two selection)
on
method, not conflict with browser event, you just hope yieldone behavior only, use a name other than
on
is better, or, just simple:param
to declare a event. e.g.I think first solution is better, because
params.on_save
is just like usual param,it just use logic instead of a variable.
The text was updated successfully, but these errors were encountered: