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

Is there something similar to ruby send method in Elixir?
How do I raise a number to a power in Elixir?
has_one without belongs_to in ecto/phoenix/elixir
How to create a global view in Phoenix Framework?
Formatting a time in Elixir
How to generate a random url safe string with Elixir
Struct reuse for Modules in Elixir
phoenix_ecto : error when loading assoc
Compilation error phoenix_ecto
How to print out a map's array values in Elixir?
How to validate presence in Phoenix framework?
Halt a connection after a redirect
Preventing a mix task being included when your project is included as a mix dep
Cannot compile simple Elixir Project
Changing dependencies on runtime in phoenix
Distributed Elixir example doesn't work

Categories

HOME
sharepoint
pug
performancecounter
nuxeo
facebook-graph-api
vs-team-services
automated-tests
quill
xcode8.3
shader
currency
xamarin-studio
ndis
google-shopping
image-recognition
uiview
webmethods
symfony2-easyadmin
spring-cloud-config
r-lavaan
quartus
raphael
dspic
facebook4j
tcpclient
header-files
jquery-waypoints
pdfsharp
auditing
python-textprocessing
osmdroid
interrupt-handling
unpack
ggmap
dpi
thinking-sphinx
positioning
cell-array
gpib
getjson
piecewise
pdflatex
data-extraction
nsurlconnection
viewstate
css-counter
pmwiki
issue-tracking
image-compression
concrete5-5.7
dart-pub
stdclass
ssh.net
jupyter-console
html-agility-pack
g1gc
3scale
recycle-bin
ideone
data-integration
tuleap
production-environment
persistent
spring-data-hadoop
rollback
etherpad
static-code-analysis
castle-dynamicproxy
unity3d-editor
addin-express
visual-studio-templates
emgu
createobject
rsqlite
ebtables
iostat
spring-ioc
rmongodb
foxit
uiprogressview
qregexp
metalsmith
ng2-material
emokit
picking
django-south
jta
schtasks.exe
qbfc
divide-by-zero
viper-architecture
coypu
guzzle6
utf-32
line-numbers
temp-tables
iostream
io.js
spdy
broadcasting
json-patch
gfs
opendata
nservicebus4
image-zoom
execvp
localtime
ienumerator
ng-pattern
grunt-contrib-compass
pep8
client-library
objcmongodb
bulbs
static-variables
gdt
userid
windows-live-id
noir
nagle
pantheios
svn-hooks
msn
kpi
project-lifecycle
cots

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