Skip to content

Instantly share code, notes, and snippets.

@darrencauthon
Last active August 29, 2015 14:05
Show Gist options
  • Select an option

  • Save darrencauthon/042a8e80c087e0625b7d to your computer and use it in GitHub Desktop.

Select an option

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