Extract Partial

I am having problems refactoring a file. In particular when I select the <header>...</header> section of the code below and go to the refactor -> extract option, I don't get the option to extract partial. instead i get a greyed out "Include File.." otpion which does nothing.

Occasionally I can select pieces of code like this and it works ( although sometimes it gives the same answer as above )

  <title>Heropro</title>
  
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
  <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
  <%= csrf_meta_tags %>
</head>
<body>
 
Any ideas? I have pasted the whole html.erb view below.

 
<!DOCTYPE html>
<html>
<head>
  <title>Heropro</title>
  
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
  <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
  <%= csrf_meta_tags %>
</head>
<body>


<header>
  <!-- Dropdown Structure -->
  <ul id="dropdown1" class="dropdown-content">
    <li><a href="#!">
My Profile</a></li>
    <li><a href="#!">
My Courses</a></li>
    <li class="divider"></li>
    <li>
<%= link_to "Log out", destroy_user_session_path, method: :delete %></li>
  </ul>

  <ul id="dropdown2" class="dropdown-content">
    <li><a href="#!">
My Profile</a></li>
    <li><a href="#!">
My Courses</a></li>
    <li class="divider"></li>
    <li>
<%= link_to "Log out", destroy_user_session_path, method: :delete %></li>
  </ul>

  <nav class=" brown lighten-4 z-depth-2">
    <div class="container">
      <div class="nav-wrapper">
        <a href="#!" class="brand-logo">
Hero Pro</a>
        <a href="#" data-activates="mobile-demo" class="button-collapse"><i class="material-icons">
menu</i></a>
        <ul class="right hide-on-med-and-down">
          <li><a href="#">
Courses</a></li>
          <% if (!user_signed_in?)
%>
              <li><%= link_to "Sign Up", new_user_registration_path %></li>
              <li><a href="#">
Login</a></li>
          <% else
%>
              <!-- Dropdown Trigger -->
              <li><a class="dropdown-button" href="#!" data-activates="dropdown1">
<%= current_user.email %>
                <i class="material-icons right"></i></a></li>
          <% end
%>
        </ul>
        <ul class="side-nav" id="mobile-demo">
          <li><a href="#">
Courses</a></li>
          <li><a href="#">
Sign Up</a></li>
          <% if (!user_signed_in?)
%>
              <li><a href="#">Login</a></li>
          <% else
%>
              <li><a class="dropdown-button" href="#!" data-activates="dropdown2"><%= current_user.email %>
                <i class="material-icons right"></i></a></li>
          <% end
%>
        </ul>

      </div>
    </div>
  </nav>
</header>


<p class="notice">
<%= notice %></p>

<p class="alert">
<%= alert %></p>


<main>
  <div class="container">
    
<%= yield %>
  </div>
</main>

<footer class="page-footer brown lighten-4">
  <div class="container">
    <div class="row">
      <div class="col l6 s12">
        <h5 class="white-text">
Hero Pro</h5>

        <p class="grey-text text-lighten-4">
You can use rows and columns here to organize your footer content.</p>
      </div>
      <div class="col l4 offset-l2 s12">
        <h5 class="white-text">
Social</h5>
        <ul>
          <li><a class="grey-text text-lighten-3" href="#!">
Twitter</a></li>
          <li><a class="grey-text text-lighten-3" href="#!">
Facebook</a></li>
          <li><a class="grey-text text-lighten-3" href="#!">
Google Plus</a></li>
          
<%= link_to "About Us", pages_about_path, class: "grey-text text-lighten-4" %>
        </ul>
      </div>
    </div>
  </div>
  <div class="footer-copyright">
    <div class="container">
      
© 2014 Copyright Text
      <a class="grey-text text-lighten-4 right" href="#!">More Links</a>
    </div>
  </div>
</footer>

</body>

<script>
    $
(".button-collapse").sideNav();
    $
(".dropdown-button").dropdown();
</script>
</html>
0
3 comments

Thanks for the reply.

This seems to have been around for quite some time according to that thread and, IMO, it is pretty fundamental functionality.

I agree with a couple of other posts on the thread you posted. Rubymine seems to be cramming itself with rather niche functionality and neglecting making the basics work really well. In other words, the thing that IDEs get the most criticism for, being bloated and complex, is now very true for rubymine.

To think that I may have to pay for an upgrade just to correct a buggy, basic function ( if it is actually fixed ) is irritating.

0

FYI, Issue was fixed

0

Please sign in to leave a comment.