Method: Pageflow::EntriesHelper#entry_stylesheet_link_tag

Defined in:
app/helpers/pageflow/entries_helper.rb

#entry_stylesheet_link_tag(entry) ⇒ Object



148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# File 'app/helpers/pageflow/entries_helper.rb', line 148

def entry_stylesheet_link_tag(entry)
  url = pageflow.polymorphic_path(entry.stylesheet_model,
                                  action: :stylesheet,
                                  v: entry.stylesheet_cache_key,
                                  p: Pageflow::VERSION,
                                  format: 'css')

  # We cannot use stylesheet_link_tag here since that always uses
  # the asset host. Entry stylesheet requests are subject to
  # `Configuration#public_entry_request_scope` and
  # `Configuration#public_entry_redirect` which might depend on
  # the hostname.
  tag(:link,
      rel: 'stylesheet',
      href: url,
      media: 'all',
      data: {name: 'entry'})
end