Class: LinkToCurrentSnip

Inherits:
Dynasnip show all
Defined in:
lib/vanilla/dynasnips/link_to_current_snip.rb

Instance Attribute Summary

Attributes inherited from Dynasnip

#enclosing_snip

Attributes inherited from Vanilla::Renderers::Base

#app

Instance Method Summary collapse

Methods inherited from Dynasnip

all, attribute, #method_missing, snip_attributes, snip_name, usage

Methods inherited from Vanilla::Renderers::Base

escape_curly_braces, #include_snips, #initialize, #parse_snip_reference, #prepare, #process_text, #raw_content, #render, render, #render_without_including_snips, snip_regexp, #soup

Methods included from Vanilla::Routes

#edit_link, #existing_link, #link_to, #new_link, #url_to, #url_to_raw

Constructor Details

This class inherits a constructor from Vanilla::Renderers::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Dynasnip

Instance Method Details

#handle(*args) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/vanilla/dynasnips/link_to_current_snip.rb', line 9

def handle(*args)
  if app.request.snip_name == 'edit' # we're editing so don't use this name
    link_to app.request.params[:name]
  else
    link_to app.request.snip_name
  end
end