Skip to content
Closed
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
6 changes: 4 additions & 2 deletions src/lucky/asset_helpers.cr
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ module Lucky::AssetHelpers

▸ Use the 'dynamic_asset' method instead

ERROR %}
ERROR
%}
{% else %}
{% raise <<-ERROR
\n
Expand All @@ -31,7 +32,8 @@ module Lucky::AssetHelpers
▸ If you're using a variable, switch to a literal string
▸ If you can't use a literal string, use the 'dynamic_asset' method instead

ERROR %}
ERROR
%}
{% end %}
end

Expand Down
3 changes: 2 additions & 1 deletion src/lucky/error_action.cr
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ abstract class Lucky::ErrorAction
# Could also be render, json, text, etc.
head status: 500
end
ERROR %}
ERROR
%}
end
end
3 changes: 2 additions & 1 deletion src/lucky/exposeable.cr
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@ module Lucky::Exposeable
{% else %}
{% method_name.raise <<-ERROR
Can't unexpose '#{method_name}' because it was not previously exposed. Check the exposure name or use 'unexpose_if_exposed #{method_name}' if the exposure may or may not exist
ERROR %}
ERROR
%}
{% end %}
{% end %}
end
Expand Down
4 changes: 2 additions & 2 deletions src/lucky/flash.cr
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ module Lucky
def self.from_session(session : Lucky::Session::AbstractStore) : Store
json = JSON.parse session.fetch(Lucky::Flash::Handler::PARAM_KEY, "{}")
new.tap do |flash|
json.each do |key, value|
flash.now[key.to_s] = value.to_s
json.as_h.each do |key, value|
flash.now[key] = value.to_s
end
end
rescue e : JSON::ParseException
Expand Down
3 changes: 2 additions & 1 deletion src/lucky/html_page.cr
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ module Lucky::HTMLPage
Instead try:
* The `para` method if you want to use an HTML paragraph.
* The `pp` method to pretty print information for debugging.
ERROR %}
ERROR
%}
end
end
2 changes: 1 addition & 1 deletion src/lucky/params.cr
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class Lucky::Params
private def nested_json_params(nested_key : String) : Hash(String, String)
nested_params = {} of String => String

JSON::Any.new(parsed_json.as_h[nested_key]).each do |key, value|
parsed_json.as_h[nested_key].as_h.each do |key, value|
nested_params[key.to_s] = value.to_s
end

Expand Down
3 changes: 2 additions & 1 deletion src/lucky/tags/input_helpers.cr
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ module Lucky::InputHelpers
might have an 'admin' flag on a User. If all fields were fillable,
a malicious user could set the 'admin' flag to 'true' on any form.

ERROR %}
ERROR
%}
end

macro generate_helpful_error_for(input_method_name)
Expand Down
4 changes: 2 additions & 2 deletions src/run_macros/generate_asset_helpers.cr
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ class AssetManifestBuilder
manifest_file = File.read(MANIFEST_PATH)
manifest = JSON.parse(manifest_file)

manifest.each do |key, value|
puts %({% ASSET_MANIFEST["#{key.as_s}"] = "#{value.as_s}" %})
manifest.as_h.each do |key, value|
puts %({% ASSET_MANIFEST["#{key}"] = "#{value.as_s}" %})
end
end

Expand Down