Module: Merb::MerbSliceSms::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.



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

def app_path_for(type, *segments)
  ::MerbSliceSms.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.



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

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.



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

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.



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

def public_path_for(type, *segments)
  ::MerbSliceSms.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.



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

def slice_path_for(type, *segments)
  ::MerbSliceSms.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.



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

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