Allen Fair
2006-Dec-17 20:37 UTC
Markaby template & layout (can''t get them to work together)
Hi all, I am starting a new rails app with the Markaby plugin (had some issues installing, but think its working). First, i created an index.mab file for a controller containing: h1 "First template" That rendered fine. Also, I do not have a "def index ..." in the controller. Then I created an app/layouts/application.mab file. It didn''t get picked up until after I restarted the webrick server. However, After I added this code (from the markaby docs) it failed to render the controller template. Tweaking code showed that the index.mab template was still being processes, but never assigned to @content_for_layout, which is nil. html do head do title "hi" #action_name stylesheet_link_tag ''scaffold'' end body do p flash[:notice], :style => "color: green" self << @content_for_layout end end Is there anything special I forgot to get these Markaby templates to play together? Thanks, Allen PS - Side question: Is there textmate highlighting for .mab templates? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Jamie Orchard-Hays
2006-Dec-17 23:01 UTC
Re: Markaby template & layout (can''t get them to work together)
for TextMate highlighting, just use the ruby syntax coloring. I seem to remember reading that using a mab file for your layout isn''t recommended, but in any case, I believe @content_for_layout has been deprecated for yield. --Jamie On Dec 17, 2006, at 3:37 PM, Allen Fair wrote:> > Hi all, > > I am starting a new rails app with the Markaby plugin (had some issues > installing, but think its working). > > First, i created an index.mab file for a controller containing: > > h1 "First template" > > That rendered fine. Also, I do not have a "def index ..." in the > controller. > > Then I created an app/layouts/application.mab file. It didn''t get > picked > up until after I restarted the webrick server. However, After I added > this code (from the markaby docs) it failed to render the controller > template. > > Tweaking code showed that the index.mab template was still being > processes, but never assigned to @content_for_layout, which is nil. > > html do > head do > title "hi" #action_name > stylesheet_link_tag ''scaffold'' > end > > body do > p flash[:notice], :style => "color: green" > self << @content_for_layout > end > end > > Is there anything special I forgot to get these Markaby templates to > play together? > > Thanks, > Allen > > PS - Side question: Is there textmate highlighting for .mab templates? > > -- > Posted via http://www.ruby-forum.com/. > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---