Skip to content

Fix bug when previewing with empty string#6

Merged
tomasc merged 1 commit intotomasc:masterfrom
jankeesvw:fix-bug-with-empty-content
Apr 15, 2017
Merged

Fix bug when previewing with empty string#6
tomasc merged 1 commit intotomasc:masterfrom
jankeesvw:fix-bug-with-empty-content

Conversation

@jankeesvw
Copy link

I noticed an error on our production site when people where clicking preview without filling out text. The problem can be fixed by making this small change to the previews_controller.rb.

This is the exception stack trace:

ActionController::ParameterMissing (param is missing or the value is empty: text):
  actionpack (4.2.8) lib/action_controller/metal/strong_parameters.rb:251:in `require'
  simple_form_markdown_editor (0.0.9) app/controllers/simple_form_markdown_editor/previews_controller.rb:20:in `text'
  simple_form_markdown_editor (0.0.9) app/controllers/simple_form_markdown_editor/previews_controller.rb:16:in `text_preview'
  simple_form_markdown_editor (0.0.9) app/controllers/simple_form_markdown_editor/previews_controller.rb:8:in `block (2 levels) in preview'
  actionpack (4.2.8) lib/action_controller/metal/mime_responds.rb:217:in `respond_to'
  simple_form_markdown_editor (0.0.9) app/controllers/simple_form_markdown_editor/previews_controller.rb:7:in `preview'

I noticed an error on our production site when people where clicking
preview without filling out text. The problem can be fixed by making
this small change to the `previews_controller.rb`.

This was the exception stack trace:

```
ActionController::ParameterMissing (param is missing or the value is empty: text):
  actionpack (4.2.8) lib/action_controller/metal/strong_parameters.rb:251:in `require'
  simple_form_markdown_editor (0.0.9) app/controllers/simple_form_markdown_editor/previews_controller.rb:20:in `text'
  simple_form_markdown_editor (0.0.9) app/controllers/simple_form_markdown_editor/previews_controller.rb:16:in `text_preview'
  simple_form_markdown_editor (0.0.9) app/controllers/simple_form_markdown_editor/previews_controller.rb:8:in `block (2 levels) in preview'
  actionpack (4.2.8) lib/action_controller/metal/mime_responds.rb:217:in `respond_to'
  simple_form_markdown_editor (0.0.9) app/controllers/simple_form_markdown_editor/previews_controller.rb:7:in `preview'
@tomasc
Copy link
Owner

tomasc commented Apr 15, 2017

@jankeesvw thanks for this. I will merge and release as 0.0.10. Please note a 1.0 with refactored markup is coming soon (see the markup-refactor branch).

@tomasc tomasc merged commit c19c159 into tomasc:master Apr 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants