Last active
October 25, 2016 01:11
-
-
Save shunwitter/721a26e95dababb97a0bde2bb57c67d9 to your computer and use it in GitHub Desktop.
Vuejs Simple Convention
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
# /api/my_api_controller.rb | |
class Api::MyApiController < Api::BaseController | |
def my_component_a_data | |
# Fetch data from rails and return json | |
@my_data_a = { title: 'Hello world', body: 'Vue.js is simple and easy to use.' } | |
render json: @my_data_a | |
end | |
def my_component_b_data | |
# Fetch data from rails and return json | |
render json: @my_data_b | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment