The Wayback Machine - https://web.archive.org/web/20210202191547/https://github.com/topics/crystal
Skip to content
#

Crystal

crystal logo

Crystal is a programming language with friendly syntax, static type checking and modern stdlib. It compiles into efficient, easy-to-distribute native code.

Here are 1,469 public repositories matching this topic...

jwoertink
jwoertink commented Dec 1, 2020

Describe the bug
In your Actions, you could respond to different formats based on the accepted format. Normally it might just be html, but you may have something that looks like:

get "/me" do
  if ajax?
    json({email: current_user.email})
  else
    html ShowPage
  end
end

To Reproduce

accepted_formats [:html, :ajax], default: :html

Created by Ary Borenszweig, Juan Wajnerman

Released June 2011

Organization
crystal-lang
Website
crystal-lang.org
Wikipedia
Wikipedia