Last active
August 29, 2015 14:05
-
-
Save darrencauthon/042a8e80c087e0625b7d to your computer and use it in GitHub Desktop.
Kilt Front-end Example
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
| class BagpipeController < ApplicationController | |
| def index | |
| @bagpipes = Kilt.bagpipes | |
| end | |
| def view | |
| @bagpipe = Kilt.get(params[:id]) | |
| end | |
| 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
| <% @bagpipes.each do |bagpipe| %> | |
| <a href="/bagpipes/<%= bagpipe['slug'] %>"><%= bagpipe['name'] %></a> | |
| <% 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
| Rails.application.routes.draw do | |
| mount Kilt::Engine => '/admin', as: 'kilt_engine' | |
| get '/bagpipes' => 'bagpipe#index' | |
| get '/bagpipes/:id' => 'bagpipe#view' | |
| 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
| <%= @bagpipe['name'] %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment