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 bug when previewing with empty string #6

Merged
merged 1 commit into from Apr 15, 2017
Merged

Conversation

@jankeesvw
Copy link
Contributor

@jankeesvw jankeesvw commented Apr 3, 2017

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 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
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.