layout in application controller

18 views
Skip to first unread message

tom

unread,
Oct 17, 2017, 5:13:19 PM10/17/17
to Ruby on Rails: Talk
hi,

not sure why this is not working:


layout :resolvelayout

dev resolvelayout
 if 1==2
 "a"
else
"b"
end

end


I did restart sever...
thx

Hassan Schroeder

unread,
Oct 17, 2017, 6:01:58 PM10/17/17
to rubyonrails-talk
On Tue, Oct 17, 2017 at 2:12 PM, tom <toma...@gmail.com> wrote:

> not sure why this is not working:

What does "not working" mean?

What happens? What do you expect to happen?

--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
twitter: @hassan
Consulting Availability : Silicon Valley or remote

tom

unread,
Oct 18, 2017, 7:24:05 AM10/18/17
to Ruby on Rails: Talk
the function aka method does not get called.
if I insert a print or something nothing shows in the log.

I assumed you can set layout in application controller....



--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yA-mPQDPguvBA-fCsBAWRYtnHO29_h%3D3H7CNqCxhNRWAQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Hassan Schroeder

unread,
Oct 18, 2017, 10:42:55 AM10/18/17
to rubyonrails-talk
On Wed, Oct 18, 2017 at 4:23 AM, tom <toma...@gmail.com> wrote:
> the function aka method does not get called.
> if I insert a print or something nothing shows in the log.
>
> I assumed you can set layout in application controller....

You absolutely can.

Aside from the misspelling and the nonsense "condition" your method
should work (be called); what happens if you change e.g.

layout :resolvelayout

to

layout :b0rk3d

You should get an error for an "undefined local variable or method".
Reply all
Reply to author
Forward
0 new messages