Accessing the Rails model from a CMS page

43 views
Skip to first unread message

Gil

unread,
Sep 13, 2016, 3:41:52 AM9/13/16
to comfortable-mexican-sofa
Hey,

I'm new to this amazing CMS (fits Rails very well) but I try to hack my way through some topics which aren't fully documented.

I've managed to render a CMS page from my rails controller using this style of code from the documentation:
class EntriesController < ApplicationController
  def index
    @entries = Entry.all
    render :cms_page => '/entries'
  end
end

The page CMS is rendered Ok, what I wonder is how can I access the @entries data from the CMS page itself?
It's a no brainer for a rails view but couldn't figure how to do it from the CMS page.

Thanks
Gil.

Kadu Diógenes

unread,
Sep 14, 2016, 7:58:50 AM9/14/16
to comfortable-mexican-sofa
Reply all
Reply to author
Forward
0 new messages