layout in application controller

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

layout in application controller

tommaso159
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

--
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CADQqhMcQGn2oEVVP8_qts9Yuf_h3x%3DoE5g37No_10OBJQoEKog%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: layout in application controller

Hassan Schroeder-2
On Tue, Oct 17, 2017 at 2:12 PM, tom <[hidden email]> wrote:

> not sure why this is not working:

What does "not working" mean?

What happens? What do you expect to happen?

--
Hassan Schroeder ------------------------ [hidden email]
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
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 [hidden email].
To post to this group, send email to [hidden email].
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.
Reply | Threaded
Open this post in threaded view
|

Re: layout in application controller

tommaso159
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....



On Oct 17, 2017 6:01 PM, "Hassan Schroeder" <[hidden email]> wrote:
On Tue, Oct 17, 2017 at 2:12 PM, tom <[hidden email]> wrote:

> not sure why this is not working:

What does "not working" mean?

What happens? What do you expect to happen?

--
Hassan Schroeder ------------------------ [hidden email]
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
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 [hidden email].
To post to this group, send email to [hidden email].
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.

--
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CADQqhMd7RuaEAf7TK04tcFxukQ5aVZc1J9eexzznC8W-L8izZg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: layout in application controller

Hassan Schroeder-2
On Wed, Oct 18, 2017 at 4:23 AM, tom <[hidden email]> 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".

--
Hassan Schroeder ------------------------ [hidden email]
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yD_F0t-Dns492-DVszgFBuN1De3QF9a7W30QXYNNxzeKg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.