Most voted "erb" questions
`erb` is a template engine implemented in ruby. Commonly used to inject Ruby code into HTML documents, similar to JSP, ASP and PHP.
Learn more…9 questions
Sort by count of
-
3
votes1
answer532
viewsHow to render a partials structure from another directory in Rails?
1) Structure of views Assuming I have two sets of views, the set A and the set B. Both sets are similar possessing the view index.html.erb and the partials _index.html.erb, _new.html.erb,…
-
1
votes2
answers162
viewsProblem when rendering partials dynamically
I have the following code: <table class="table table-bordered table-striped" border="0"> <% @time_line.each do |time_line| %> <%= render partial: partial_name( get_type(time_line) ),…
-
1
votes1
answer123
viewsSelect sex with Enum
I made the field select sex that way: model: enum sexo: [:feminino, :masculino, :desconhecido] def self.sexes_for_select sexos.keys.map{ |x| [x.humanize, x] } end form: <%= f.select :sexo,…
-
1
votes1
answer20
viewsproperty Prompt is not working
<div class="field col-xs-3"> <%= f.label :modelo_id %> <%= f.select :modelo_id, options_for_select( @modelos.collect { |modelo| [modelo.nome.titleize, modelo.id] },…
-
1
votes1
answer240
viewserror handling, Rails 4
This error happens when the user does not select the option from the select field. The error would even be dealt with if it had not Collect: NoMethodError in Subdisciplinas#create Showing…
-
1
votes0
answers74
viewsHow to make a local variable an instance variable for an ERB template with Binding?
Below I exemplify my need in a code where I need to redefine variables such as @dispute = dispute so that they are instance variables and the template loaded by ERB can access them through the…
-
0
votes1
answer131
viewssyntax error, Unexpected ',', expecting ')' - Rails 4
The Rails interpreter is sending me this message in the following line of code: ... <li> <%= form_tag("search", { method: "get", class: "navbar-form navbar-right", role: "search" }) do…
-
0
votes1
answer47
viewscheck if method in backend is true and client too
I have a code that in my backend it returns true or false, I am working with ruby and Rails 5. then I have la an if more or less so ja: <% if @order? %> <h2> teste 2 <h2>…
-
0
votes1
answer266
viewsHelp With Relationship Between 3 #Rails Tables
I would like your help in this problem below I have 3 tables: Product Purshase Supplier supplier_id product_id name class Purshase < ActiveRecord::Base belongs_to :product end class Product <…