Skip to content
This repository was archived by the owner on Feb 7, 2020. It is now read-only.

MIME Types support #147

@botanicus

Description

@botanicus
class Application < Rango::Controller
  format(:json) do |object|
    object.to_json
  end
end

class Post < Application
  def show(id)
    if format.html?
      render "post.html", post: post
    else
      display post
    end
  end
end
class Application < Rango::Controller
  format(:json) do |object|
    object.to_json
  end

  format(:html) do |object|
    path = self.template_path(request.action)
    render path
  end
end

class Post < Application
  def show(id)
    display post
  end
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions