Closed mibamur closed 7 years ago
now looked clearly
#assets_generator.rb
require 'rails/generators/named_base'
module Opal
module Generators
class AssetsGenerator < ::Rails::Generators::NamedBase
source_root __dir__+'/templates'
def copy_opal
template 'javascript.js.rb', File.join('app/assets/javascripts', class_path, "#{file_name}.js.rb")
end
end
end
end
and we should use class_name
instead controller_class_name
in templates
ping @elia @meh @vais @Mogztter
I`d test it rails 5.0 ruby 2.3.1
README.md should have something about generators I do it all later
Document.on 'turbolinks:load' do |evt|
puts "turbolinks:load #{evt}"
end
opal-rails/lib/rails/generators/opal/assets/assets_generator.rb
maybe we can move opal to another assets folder and named it opal
, rename opal_generator.rbClassView
and method like say_hello_when_a_link_is_clicked
Auto binding -> define controller_name
, action_name
in id
, class
or data-attr
haml example %body{ class: "#{controller_name} #{action_name}", "data-controller-name"=>"#{controller_name}" }
Something else here? Sockets? I do not have idea now
create.js.rb
for example append_path
config/initializers/opal-rails.rb
after bundle install (draft)Rails.application do |config|
if Rails.env.production?
config.opal.source_map_enabled = false
end
config.opal.optimized_operators = true
config.opal.arity_check = false
end
@mibamur Hello, are you waiting something from me ?
@Mogztter what should ClassView
do? General idea is bind to action or anything, like controller.coffee
?
@mibamur sorry for the delay, I was quite busy in july and your PRs went off the radar.
I merged everything so far, thank you!
I like very much:
PRs for those would be very appreciated 😄.
As of sprockets4, support for it is under development. Sprockets support has been extracted to opal-sprockets to allow for independent upgrades.
@mibamur is this still a work in progress or should I close the issue?
Closing, let me know if you need to reopen this
Hello!
plural bug - fixed here
controller_class_name
controller_name
rails g controller home index
I tried to find it ...