0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Adds easy defaults for writing Windows 8.1 tile functionality on top of Rails
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 4.0

Runtime

~> 4.0
 Project Readme

Windows 8.1 Tile Helpers Version Build Status Abandoned

Adds easy defaults for writing Windows 8.1 tile functionality on top of Rails.

Installation

Add this line to your application's Gemfile:

gem 'tiles-rails'

And then execute:

$ bundle

Or install it yourself as:

$ gem install tiles-rails

Usage

Creating a notification feed

Create a controller to handle your requests, e.g. app/controllers/feeds_controller.rb:

class FeedsController < ApplicationController
  respond_to :tile

  def show
    @posts = Post.limit(3)
    respond_with @posts
  end

end

Now create a view to render the feed, e.g. app/views/feeds/show.tile.builder:

tile_feed do |feed|
  feed.binding(branding: 'logo', template: 'TileSquare150x150Text04', fallback: 'TileSquareImage') do
    feed.text(@posts.first.title, id: '1')
  end

  feed.binding(branding: 'logo', template: 'TileWide310x150Text03', fallback: 'TileWideImage') do
    feed.text(@posts.first.title, id: '1')
  end

  feed.binding(branding: 'logo', template: 'TileSquare310x310TextList02', contentId: @posts.first.id) do
    @posts.each_with_index do |post, index|
      feed.text(post.title, id: "#{index + 1}")
    end
  end
end

Update your config/routes.rb with the new route:

Blog::Application.routes.draw do
  ...

  resource :feed, only: [:show]
end

Now you can access your notification feed at http://localhost:3000/feed.tile.

Meta

Contributors

License

Copyright (c) 2013 Daniel Perez Alvarez (unindented.org). This is free software, and may be redistributed under the terms specified in the LICENSE file.