Created
March 16, 2018 19:01
-
-
Save raketbizdev/e6121017ddf4b8a1feb92e1518a0bffd to your computer and use it in GitHub Desktop.
This file contains 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
<%= form_with(model: document, local: true) do |form| %> | |
<% if document.errors.any? %> | |
<div id="error_explanation"> | |
<h2><%= pluralize(document.errors.count, "error") %> prohibited this document from being saved:</h2> | |
<ul> | |
<% document.errors.full_messages.each do |message| %> | |
<li><%= message %></li> | |
<% end %> | |
</ul> | |
</div> | |
<% end %> | |
<div class="field"> | |
<%= form.label :title %> | |
<%= form.text_field :title, id: :document_title %> | |
</div> | |
<div class="field"> | |
<%= form.label :content %> | |
<%= form.text_area :content, id: :document_content %> | |
</div> | |
<div class="actions"> | |
<%= form.submit %> | |
</div> | |
<% end %> |
This file contains 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
# I try the helper Medthod but its not working | |
module ApplicationHelper | |
def my_name | |
your_name = "Ruel Nopal" | |
end | |
end |
This file contains 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
class Document < ApplicationRecord | |
# Try in Model | |
def my_name | |
your_name = "Ruel Nopal" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment