You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to pad...@googlegroups.com
I have some code that is common to two models. So I put it a module and put
the module in a file in the model directory and include the module. All
works. I would like to use a method in one of the helpers. Helpers normally
are visible only in controllers and views. How do include it in a model?
The helper method is defined:
module GreenBox
class App
module GreenBoxHelper
def page_number(count)
(count-1)/PAGE_SIZE + 1
end
end
helpers GreenBoxHelper
end
end
If the model common file:
include GreenBox::App::GreenBoxHelper
does not work, the constant GreenBox::App::GreenBoxHelper is not defined.
TIA,
Jeffrey
Adam Daniels
unread,
Jan 19, 2018, 9:17:01 AM1/19/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Padrino Framework
Can you try requiring the helper module at the top of your model?
Jeffrey Taylor
unread,
Jan 23, 2018, 9:24:14 AM1/23/18
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message