Individual tweets are now viewable in their own pages
This commit is contained in:
@@ -6,6 +6,14 @@ defmodule MixerWeb.PageController do
|
||||
end
|
||||
|
||||
def index(conn, _params) do
|
||||
render_spa(conn, nil)
|
||||
end
|
||||
|
||||
def show(conn, %{"tweet_id" => tweet_id}) do
|
||||
render_spa(conn, tweet_id)
|
||||
end
|
||||
|
||||
defp render_spa(conn, tweet_id) do
|
||||
asset_host = Application.get_env(:waffle, :asset_host, "http://localhost:3900")
|
||||
bucket = Application.get_env(:waffle, :bucket, "mixer-bucket")
|
||||
|
||||
@@ -13,7 +21,8 @@ defmodule MixerWeb.PageController do
|
||||
|> put_root_layout(html: {MixerWeb.Layouts, :spa_root})
|
||||
|> render(:index,
|
||||
current_user: conn.assigns[:current_user],
|
||||
media_host: "#{asset_host}/#{bucket}"
|
||||
media_host: "#{asset_host}/#{bucket}",
|
||||
tweet_id: tweet_id
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user