Skip to content

Commit

Permalink
controllers
Browse files Browse the repository at this point in the history
  • Loading branch information
rderoldan1 committed Jun 3, 2014
1 parent da5aee8 commit 585b857
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ source 'https://rubygems.org'

# Specify your gem's dependencies in md_simple_editor.gemspec
gemspec

gem 'redcarpet'
5 changes: 5 additions & 0 deletions app/controllers/md_simple_editor_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class MdSimpleEditorController < ApplicationController
def preview

end
end
5 changes: 4 additions & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Rails.application.routes.draw do
get 'md/preview'
get 'md_simple_editor/preview' do
options = {autolink: true, tables: true, hard_wrap: true, no_intraemphasis: true, fenced_code:true, gh_blockcode: true}
Redcarpet::Markdown.new(Redcarpet::Render::HTML, options).render(params['md_simple']).html_safe
end
end
1 change: 1 addition & 0 deletions md_simple_editor.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "rake"

spec.add_runtime_dependency "font-awesome-rails", "~> 4.0.3.1"
spec.add_runtime_dependency "redcarpet", "~> 3.1.2"
end

0 comments on commit 585b857

Please sign in to comment.