Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deprecation warning on Rails 6.0 #51

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ gemspec
gem 'rails'
gem 'rspec-rails', '>= 3.2.0'
gem 'sqlite3'
gem 'rails-controller-testing'
5 changes: 3 additions & 2 deletions lib/faml/rails_handler.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# frozen_string_literal: true
module Faml
class RailsHandler
def call(template)
def call(template, source = nil)
source ||= template.source
Engine.new(
use_html_safe: true,
generator: Temple::Generators::RailsOutputBuffer,
filename: template.identifier,
).call(template.source)
).call(source)
end
end
end
3 changes: 3 additions & 0 deletions spec/rails/app/assets/config/manifest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
//= link_tree ../images
//= link_directory ../javascripts .js
//= link_directory ../stylesheets .css
2 changes: 1 addition & 1 deletion spec/rails/spec/requests/faml_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
end

it 'works with id' do
get '/books/object_ref', id: 123
get '/books/object_ref', params: { id: 123 }
expect(response).to be_ok
expect(response.body).to include("<div class='book' id='book_123'>")
end
Expand Down