Posts by Jhonatan Petronilho • 95 points
6 posts
-
0
votes1
answer41
viewsQ: Multiple classes for one student
I have a teaching application in it I have a model for Classes (Room) and another for Students (Student). In my business rule, each student can be enrolled in up to three classes. For this I simply…
-
5
votes2
answers1047
viewsQ: Difference of ' ' and ` `
I am reading ng-book 2 on Angular 2 and in one of the exercises a doubt arose. When setting up my component first code does not display the values title and link on the console, but the second works…
-
0
votes1
answer177
viewsQ: Doubt Scope of Javascript Variables
in the code below I try to use the variables lastLatitude and lastLongitude outside the local scope. I need them in initial. I’ve tried many things, someone can help me understand? <script>…
-
0
votes2
answers300
viewsA: How to delete a BD data from the Ubuntu terminal? Ruby on Rails
I don’t quite understand your question. But I will post some ways to work with records. Enter your application folder with the terminal and type: Rails console Change the "Post" to your model.…
-
1
votes0
answers30
viewsQ: Sort Activeadmin Index by Boolean
In suggestion.Rb I have the following code: index title: "Sugestões" do column "Título", :title column "Autor", :user column "Aprovado", :published actions end The last column :Published is of the…
ruby-on-railsasked Jhonatan Petronilho 95 -
3
votes3
answers670
viewsA: How to sort sql queries in the RUBY on Rails model?
A simple way is to use the direct "order" method in the controller. Ex: @users = User.order('name DESC').all In the above example we passed a query to the order method to list all users by name in…