```ruby
module ApplicationHelper
  def markdown(text)
    options = {
      filter_html:     true,
      hard_wrap:       true, 
      link_attributes: { rel: 'nofollow', target: "_blank" },
      space_after_headers: true, 
      fenced_code_blocks: true
    }

    extensions = {
      autolink:           true,
      superscript:        true,
      disable_indented_code_blocks: true
    }

    renderer = Redcarpet::Render::HTML.new(options)
    markdown = Redcarpet::Markdown.new(renderer, extensions)

    markdown.render(text).html_safe
  end

  def format_note(text)
    hashtag_regular_expression = /#(\w+)/
    text ||= ''

    hashtags = NotekatTags::Extractor.extract_tags(text)
    text_formatted = NotekatTags::Formatter.format(text)
    text_formatted = "Empty note. \n\n\n Click the button on the right to add some text!" if text_formatted == ""
    text_formatted = markdown(text_formatted)

    text_formatted
  end

  def page_header
    case controller_name
    when "notebooks"
      @notebook.name
    when "tags"
      "Your tags"
    when "calendar"
      "Calendar view"
    else
      controller_name
    end
  end

  # For Devise

  def resource_name
    :user
  end

  def resource
    @resource ||= User.new
  end

  def devise_mapping
    @devise_mapping ||= Devise.mappings[:user]
  end
end
```

Modify page_header helper to display note path if name is empty.
user
```ruby
module ApplicationHelper
  def markdown(text)
    options = {
      filter_html:     true,
      hard_wrap:       true, 
      link_attributes: { rel: 'nofollow', target: "_blank" },
      space_after_headers: true, 
      fenced_code_blocks: true
    }

    extensions = {
      autolink:           true,
      superscript:        true,
      disable_indented_code_blocks: true
    }

    renderer = Redcarpet::Render::HTML.new(options)
    markdown = Redcarpet::Markdown.new(renderer, extensions)

    markdown.render(text).html_safe
  end

  def format_note(text)
    hashtag_regular_expression = /#(\w+)/
    text ||= ''

    hashtags = NotekatTags::Extractor.extract_tags(text)
    text_formatted = NotekatTags::Formatter.format(text)
    text_formatted = "Empty note. \n\n\n Click the button on the right to add some text!" if text_formatted == ""
    text_formatted = markdown(text_formatted)

    text_formatted
  end

  def page_header
    case controller_name
    when "notebooks"
      @notebook.name || notebook_path(@notebook)
    when "tags"
      "Your tags"
    when "calendar"
      "Calendar view"
    else
      controller_name
    end
  end

  # For Devise

  def resource_name
    :user
  end

  def resource
    @resource ||= User.new
  end

  def devise_mapping
    @devise_mapping ||= Devise.mappings[:user]
  end
end
```
assistant