Posts by André Gava • 262 points
19 posts
-
-1
votes1
answer84
viewsA: pass a Java script variable to php
Javascript is a language that in this case is executed on the front end or on the user’s machine, whereas PHP is a back end language and will be executed on the server side. This way you need to…
-
1
votes0
answers54
viewsQ: Threshing variables in mustache
People the mustache promises to do wonders but it’s not my case. The Moodle is PHP but the themes now use mustache, but the screen code generated by the mustache is something like this: <nav…
-
0
votes1
answer53
viewsQ: Can Cakephp 3 be used to create screens to manipulate CRON like Sidekiq?
Have some way to create screens to manipulate CRON PHP with Cakephp3 as we have the sidekiq option for Ruby on Rails? It would be interesting to be able to list the active Jobs, and also the option…
-
0
votes1
answer236
viewsA: Save data from a WYSIWYG editor to the database
Hello I use Tiny and there is no mystery, I never did the test to put image inside the field, then you will need to search a little more, when you save data inside the textarea of Tiny it will…
-
1
votes1
answer305
viewsA: Questions about relationships in Rails "field must exists"
Hello You can do the following in Migrations: Rails g scaffold price value:decimal References:rental So Rails will create the Migration and the price model correctly saying that this model relates…
-
-1
votes1
answer154
viewsQ: Rails link to dynamic
I have the following question, in my controller has a variable that takes which model the guy is coming and sends to the view. I would like to create a link from this variable type: link_to…
-
0
votes0
answers129
viewsQ: API in existing system database
I am with a doubt, in our company we have a system, developed in Mysql and Delphi, this system is developed by a company, and we are with several development projects, several new systems (created…
-
0
votes1
answer228
viewsA: Simple Form different input for a model
Well after some tightening I did as follows (May not be the best but it worked): On my controller @financial = Financial.new(financial_params) @financial.value = financial_params[:value].gsub(/[.]/,…
-
0
votes1
answer228
viewsQ: Simple Form different input for a model
I have in my database a column value with Precision 7 and 2 big decimal type. In my form I use the simple form and also use the Mask, ie field for input value would look like this: 70.567,54…
-
0
votes1
answer76
viewsQ: Metaprogramming with ruby on Rails in a partial
I am working on a Ruby on Rails project and I am working on a module (Financial) it is linked to several models, and depending on the screen that the user is he can bring a screen with all the…
-
2
votes1
answer788
viewsQ: Redirect to another action from another controller in Rails
I am developing a simple action, when saving a register if there is value in a given field the system should redirect to a create from another model/controller. I’m having trouble making this happen…
-
0
votes1
answer69
viewsQ: Counting records updated by day Rails
How do I count up-to-date records in Rails? Next I have to receive this data in array format to pass and convert into json. I have table A which has many of Table B Through A I have to count how…
ruby-on-railsasked André Gava 262 -
2
votes1
answer817
viewsQ: How do I make the relationship many for many in Ruby on Rails with has and belongs to Many?
I have a table system and a table category, a system has many categories and a category has several systems, I wanted to use the has_and_belongs_to_many option of Rails (for being a simple relation…
-
1
votes1
answer35
viewsQ: Ruby on Rails Ordering and Relationship Parents Kids
I have a parent table and a child table, I would like to know how to make a query in the child table but sort by a parent table column. Like I want to know all the kids and order them by father’s…
ruby-on-railsasked André Gava 262 -
0
votes2
answers53
viewsA: Problem in product layout in Grid
If you’re using Bootstrap, don’t forget to use it this way to be responsive: <div class="product-layout product-grid col-lg-4 col-sm-6"></div> This div is a column with col-lg-4 the size…
-
0
votes1
answer34
viewsQ: How to disable a select associaition from simple form
I have a select Association of the simple form, the value of it passed via controler and I wish that in the form the user did not have the option to select another value. I have tried using…
-
6
votes1
answer102
viewsQ: Doubt Relationship Rails
I’m learning Rails still, and I’m in doubt if I’m doing it right. I have a Table Animal and a table Reproduction, each animal may have one or more reproductions and each reproduction will only have…
-
0
votes2
answers654
viewsA: Ruby error after updating Ubuntu
Apparently I was able to solve the problem by clicking on Edit->Profile Preferences->Command -> Run command as Session shell -> Restart terminal
-
0
votes2
answers654
viewsQ: Ruby error after updating Ubuntu
After updating Ubuntu, it no longer loads Ruby or something like that, the error message that returns is: /usr/bin/env: "ruby2.1": File or directory not found Every time I have to start the…