Created
April 13, 2017 18:25
-
-
Save mfifth/72e7bd82607c6ecb3b64dd44ca2029a3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(document).on("submit", ".resource-form", function(e) { | |
| $.ajax({ | |
| url: $(".resource-form").attr("action"), | |
| type: "POST", | |
| crossDomain: true, | |
| dataType: "html", | |
| data: $(".resource-form").serialize(), | |
| success: function(data) { | |
| $(".rails-app").html(data) | |
| }, | |
| error: function(data) { | |
| $(".form-notifications").html("<p style='color: red;'>That password is incorrect. Please try again.</p>"); | |
| console.log("This obviously doesn't work.") | |
| } | |
| }); | |
| return false | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class='rails-app'> | |
| <div class='login-portal'> | |
| <h2 style='color: blue;'>Login</h2> | |
| <%= form_tag "https://resourcecenter.herokuapp.com/login_path/check_password", remote: true, class: "resource-form" do |f| %> | |
| <%= text_field_tag :password, "", placeholder: "Enter Password", style: "background-color: #e6e6e6;" %> | |
| <%= submit_tag "Login", class: "check-pass-btn" %> | |
| <% end %> | |
| <div class='form-notifications'></div> | |
| </div> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class='category-list'> | |
| <h1 style='text-align: center; color: blue;'>Categories</h1> | |
| <ul style='list-style: none!important, padding: 0px; margin-top: 40px!important;'> | |
| <% categories.each do |category| %> | |
| <li style='margin-bottom: 10px;'> | |
| <p style='display: inline; margin: 0px;'><%= category.name %> - <%= category.supplements.count %> Files</p> | |
| <p class='file-links' style='display: inline; margin: 0px;'> <%= link_to "View Files", "https://mywebsite.herokuapp.com/#{category.name}/files", style: "color: blue;", data: {title: category.name, remote: true}, class: "view-files-link" %></p> | |
| </li> | |
| <% end %> | |
| </ul> | |
| </div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment