forked from bensmithett/sample-react-rails-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
53 additions
and
16 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,5 @@ | |
# Ignore all logfiles and tempfiles. | ||
/log/*.log | ||
/tmp | ||
|
||
.ruby-version |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<%= react_component('CommentBox', | ||
{:presenter => @presenter.to_json, :imgSrc => image_path("gundam.jpg")}, | ||
{:prerender => true}) %> | ||
<h1>Comments</h1> | ||
|
||
<%= react_component 'CommentBox', render(template: 'comments/index.json.jbuilder'), {prerender: true} %> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
json.presenter do | ||
json.comments(@comments) do |comment| | ||
json.extract! comment, :id, :author | ||
end | ||
json.form do | ||
json.action comments_path | ||
json.csrf_param request_forgery_protection_token | ||
json.csrf_token form_authenticity_token | ||
end | ||
end | ||
json.imgSrc image_path("gundam.jpg") |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
SampleReactRailsApp::Application.routes.draw do | ||
|
||
resources :comments | ||
root :to => redirect("/comments") | ||
|
||
# resource :top, controller: :top, only: :show | ||
end |