Module: Merb::Mjs::ApplicationHelper

Defined in:
app/helpers/application_helper.rb

Instance Method Summary collapse

Instance Method Details

#app_path_for(type, *segments) ⇒ String

Construct an app-level path.

Parameters:

  • The (Symbol)

    type of component.

  • *segments (Array[#to_s])

    Path segments to append.

Returns:

  • (String)

    A path within the host application, with added segments.



46
47
48
# File 'app/helpers/application_helper.rb', line 46

def app_path_for(type, *segments)
  ::Mjs.app_path_for(type, *segments)
end

#image_path(*segments) ⇒ String

Returns A path relative to the public directory, with added segments.

Parameters:

  • *segments (Array[#to_s])

    Path segments to append.

Returns:

  • (String)

    A path relative to the public directory, with added segments.



8
9
10
# File 'app/helpers/application_helper.rb', line 8

def image_path(*segments)
  public_path_for(:image, *segments)
end

#javascript_path(*segments) ⇒ String

Returns A path relative to the public directory, with added segments.

Parameters:

  • *segments (Array[#to_s])

    Path segments to append.

Returns:

  • (String)

    A path relative to the public directory, with added segments.



16
17
18
# File 'app/helpers/application_helper.rb', line 16

def javascript_path(*segments)
  public_path_for(:javascript, *segments)
end

#public_path_for(type, *segments) ⇒ String

Construct a path relative to the public directory

Parameters:

  • The (Symbol)

    type of component.

  • *segments (Array[#to_s])

    Path segments to append.

Returns:

  • (String)

    A path relative to the public directory, with added segments.



35
36
37
# File 'app/helpers/application_helper.rb', line 35

def public_path_for(type, *segments)
  ::Mjs.public_path_for(type, *segments)
end

#slice_path_for(type, *segments) ⇒ String

Construct a slice-level path.

Parameters:

  • The (Symbol)

    type of component.

  • *segments (Array[#to_s])

    Path segments to append.

Returns:

  • (String)

    A path within the slice source (Gem), with added segments.



57
58
59
# File 'app/helpers/application_helper.rb', line 57

def slice_path_for(type, *segments)
  ::Mjs.slice_path_for(type, *segments)
end

#stylesheet_path(*segments) ⇒ String

Returns A path relative to the public directory, with added segments.

Parameters:

  • *segments (Array[#to_s])

    Path segments to append.

Returns:

  • (String)

    A path relative to the public directory, with added segments.



24
25
26
# File 'app/helpers/application_helper.rb', line 24

def stylesheet_path(*segments)
  public_path_for(:stylesheet, *segments)
end