Skip to content

Commit

Permalink
[feature] no data-rails-env and data-user-agent in body attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
zbigh committed Jul 27, 2020
1 parent ab3ccfb commit 4641ce7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
loco-rails-core (0.1.1)
loco-rails-core (0.2.0)
rails (>= 5.0)

GEM
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module Loco
module Core
class FileInjectorGenerator < Rails::Generators::Base
def application_helper
file_path = Rails.root.join 'app', 'helpers', 'application_helper.rb'
file_path = Rails.root.join('app/helpers/application_helper.rb')
line = %( include Loco::Core::Helpers\n)
inject_into_file file_path, line, after: "module ApplicationHelper\n"
end
Expand All @@ -19,12 +19,7 @@ def layout
end

def layout_path
Rails.root.join(
'app',
'views',
'layouts',
'application.html.erb'
)
Rails.root.join('app/views/layouts/application.html.erb')
end
end
end
Expand Down
4 changes: 1 addition & 3 deletions lib/loco/core/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ def loco_body_data
{
'data-namespace' => namespace_name,
'data-controller' => data_controller,
'data-action' => action_name,
'data-rails-env' => Rails.env,
'data-user-agent' => request.user_agent
'data-action' => action_name
}
end

Expand Down
2 changes: 1 addition & 1 deletion lib/loco/core/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

module Loco
module Core
VERSION = '0.1.1'
VERSION = '0.2.0'
end
end

0 comments on commit 4641ce7

Please sign in to comment.