elixir


Phoenix: Use layout with templates of formats differents from html


I have the default app.html.eex in web/templates/layout/ and it works well with all my templates *.html.eex. I duplicated the app.html.eex file to app.rss.eex and I changed the content to the common RSS code to use in my *.rss.eex templates only the specific code, but it only renderize the *.rss.eex code and not to use the layout.
I tried to put in the pipeline plug :put_layout, {Exampleapp.LayoutView, :app} but it didn't work. Of course, I configured the accepts to use RSS with plug :accepts, ["html", "rss"] so that it can render *.rss.eex templates.
¿Is possible to use the layout with other formats?
¿How can I use the layout with app.rss.eex correctly?
You need to enable layouts for your new format as well. You can do that by adding the :put_layout_formats plug before :put_layout:
plug :put_layout_formats, ["html", "rss"]
plug :put_layout, ...

Related Links

Elixir macros, quoting and unquoting
Handling configuration values in mix
Why can't I pipe directly into Elixir String.length. Why do I have to wrap it in another function?
Using Phoenix Elixir render assigns to include partials
Elixir Ecto Insert empty belongs_to
Elixir EXRM upgrade No /relup file found
Remove Ecto from existing Phoenix project
How to pass a range to Enum.filter in Elixir?
Display full log (it gets shortened with “…”)
Ecto changeset and many to many association “is invalid” error
How to gracefully restart the Elixir App?
How to understand compiled Elixir Erlang function names
Can I concatenate strings in Elixir and use the pipe operator?
Elixir templates - looping through a list with iterator value
compilation error: no function clause matching in EEx.Compiler.generate_buffer/4
How to write a Ecto query that does a group_by MONTH on a datetime field

Categories

HOME
paypal
puzzle
wildcard
puppet
codeeffects
is-empty
javamail
sudo
unity2d
outlook-web-addins
nixos
uiscrollview
qt-installer
uiview
simple-injector
squarespace
postmessage
ssms-2016
device-detection
backpropagation
marathon
raphael
ghost-inspector
spring-ws
tarantool
iup
remove-method
jquery-waypoints
badge
activepython
sumo
upnp
google-api-dotnet-client
devforce
pdflatex
geopy
salesforce-chatter
.net-assembly
office365connectors
flex4.5
socketscan
median
automator
proof
chown
production-environment
chunked-encoding
jgraph
visual-studio-templates
xib
pydio
mailcatcher
dts
bacnet
foxit
spark-cassandra-connector
dojox.charting
achievements
hyperthreading
code-readability
response-headers
paypal-nvp
epl
magento-1.12
tilestache
named-ranges
omnifocus
adcolony
neoload
kraken.js
winrt-httpclient
sqljdbc
nsmatrix
astyanax
lame
database-permissions
cbcentralmanager
css-tables
feof
icefaces-3
objective-c-protocol
concurrent-programming
law-of-demeter
tcxgrid
surf
ihttphandler
.app
communicationexception
iphone-sdk-3.2
code-design
microsoft.ink
opcodes
database-diagramming

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App