Posts by Erasmo Santos • 299 points
20 posts
-
0
votes1
answer260
viewsQ: How to save given type map or array in firestore?
I tried it this way: createProduto(Produto produto){ Map<String, dynamic> model = { "nome" : produto.nome, "descricao" : produto.descricao, "precoCompra" : produto.precoCompra, "itens" :…
-
0
votes3
answers10546
viewsA: Working with Navigation Bar (smartphone native) and Action Bar BACK buttons (added via Java)
You can resolve this in the manifest by adding this attribute to the current Activity android:parentActivityName=".activity.PrincipalActivity"
-
0
votes2
answers187
viewsQ: Counter on model
I’m looking for a way to add an incremented variable to the id of a div, could someone tell me the most recommended way to do this? my difficulty in making this increment is due to the Cocoon that…
-
1
votes2
answers176
viewsQ: How to select record by position
can you tell me how I can select a record by position? How would you search for Maria’s record? Obs: do not search by id or name I found the take in the guide, but it looks for the first and the…
-
0
votes1
answer28
viewsQ: code block only works with F5
someone would tell me why this block of code only works after refreshing the page? var count = 0; $( document ).ready(function() { // alert("testando bloco"); $("#select_n").attr('id', 'select_' +…
jqueryasked Erasmo Santos 299 -
1
votes2
answers43
viewsQ: selector does not work: $("div + p")
Would someone like to tell me why this command line isn’t working: $("#marcas_select + #modelos_teste").css("background-color", "yellow"); Here’s the full code. As everyone can see the goal is to…
-
0
votes1
answer30
viewsA: Constant charging
The stupid mistake was in: questao.new instead of Questao.new Thank you Marco Vinicius
-
0
votes1
answer30
viewsQ: Constant charging
I’m having trouble with the model report. Console: LoadError (Unable to autoload constant Report_questao, expected app/models/report.rb to define it): app/controllers/pessoas_controller.rb:49:in…
-
8
votes1
answer716
viewsQ: In Ruby on Rails is the business rule on the model?
In Java the business rule is in controller, but I heard a speaker saying that in Ruby on Rails the business rule is on model. Someone confirms that to me?
-
0
votes1
answer272
viewsQ: Select state city rails4
I have a dynamic select of states and cities and my idea is to list the state capital selected first. I have the following code to list the cities but not listing the capital first: @cidades =…
-
0
votes1
answer75
viewsA: Field select duplicating with Chosen-Rails and relationship has Many through
I don’t know if I remember your problem, but this has happened to me and I solved it in params.permit. using my example:id params.require(:project).permit(:name, :description,tasks_attributes: [:id,…
-
1
votes1
answer240
viewsQ: error 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…
-
0
votes1
answer45
viewsA: create a mult model form using nested-form and Devise (Sign up)
It must look like this: def configure_permitted_parameters devise_parameter_sanitizer.permit(:sign_up) do |user_params| user_params.permit({ roles: [] }, :email, :password, :password_confirmation)…
deviseanswered Erasmo Santos 299 -
1
votes1
answer20
viewsQ: property 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
answer123
viewsQ: Select 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,…
-
0
votes0
answers51
viewsQ: JS only works by updating the page
Click on the button: <td><%= link_to 'simulacao', simulacao_path(simulado) %></td> on the simulation/id page there is another button that requires js, but it only works if I update…
-
1
votes1
answer54
viewsQ: Perform searches using repetitions
I created the following method to fetch random people from a certain party, the problem is that if I want to add ten more people from another party it does not add, only replaces the search without…
-
2
votes1
answer54
viewsQ: Search for random objects using conditions
I want to seek for example 10 random people of the same party I did as follows, but this selecting people from all parties, what can be done? = D class Pessoa < ActiveRecord::Base class <<…
-
1
votes2
answers280
viewsA: List random objects
thanks for the reply I did + or - what Voce spent only in the class Car < Activerecord and called the method in the view that way: class Carro < ActiveRecord::Base class << self def…
-
0
votes2
answers280
viewsQ: List random objects
How could I generate random cars in the following model? it would be better to do this in controller? class Pessoa < ActiveRecord::Base has_many :carros end…