Last active
June 6, 2018 05:37
-
-
Save suhanlee/53cfb6ccfb8801f862bb98651a933c24 to your computer and use it in GitHub Desktop.
custom mime format
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# views/test/index.rb.erb | |
<% | |
@test =1 | |
%> | |
<%= @test %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/mime_types.rb | |
Mime::Type.register "text/erb", :rb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/routes.rb | |
Rails.application.routes.draw do | |
get '/test' => 'test#index' | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/controllers/test_controller.rb | |
class TestController < ApplicationController | |
def index | |
respond_to do |format| | |
format.rb | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment