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 MyController < Mack::Controller::Base | |
# action code omitted... | |
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
class MyController | |
include Mack::Controller | |
# action code omitted... | |
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
module Mack | |
module ViewHelpers | |
module MyHelpers | |
# methods here | |
end | |
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
class MyController | |
include Mack::Controller | |
end | |
module Mack | |
module ControllerHelpers | |
module MyController | |
# methods here | |
end | |
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
class Admin::UsersController | |
include Mack::Controller | |
end | |
module Mack | |
module ControllerHelpers | |
module Admin | |
module UsersController | |
# methods here | |
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
module Mack | |
module Rendering | |
module Engine | |
class Pdf < Mack::Rendering::Engine::Base | |
def render(io, binding) | |
@_pdf = ::PDF::Writer.new | |
self.view_template.instance_variable_set("@_pdf", @_pdf) | |
eval(io, binding) | |
@_pdf.render |
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
pdf.select_font "Times-Roman" | |
pdf.fill_color(Color::RGB::Red) | |
pdf.text @post.title, :font_size => 24, :justification => :center | |
pdf.fill_color(Color::RGB::Black) | |
pdf.text "by #{@post.email}", :font_size => 12, :justification => :center | |
pdf.with_options(:font_size => 10, :justification => :left) do |p| | |
p.text "\n" | |
p.text @post.body | |
p.text "\n" | |
p.text "Created at: #{@post.created_at}" |
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
require_gems do |gem| | |
gem.add "pdf-writer", :version => "1.1.8", :libs => "pdf/writer" | |
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
# config/initializers/gems.rb | |
require_gems do |gem| | |
gem.add "mack-data_mapper", :libs => "mack-data_mapper" | |
gem.add "mack-distributed", :libs => "mack-distributed" | |
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
# config/app_config/default.yml or your <environment>.yml file of choice | |
# Share your routes? true/false | |
mack::share_routes: true | |
# Share your objects? true/false | |
mack::share_objects: true | |
# Share your views/layouts? true/false | |
mack::share_views: true | |
# What is the UNIQUE name for this application? | |
# This is used to be able to register the services |