Posts by Luan Vicente • 314 points
15 posts
-
1
votes1
answer188
viewsQ: Is it mandatory to use belongs_to in Activerecord?
It is mandatory that in order to have an association between two models, I have belongs_to and has_one? Or it is possible to use only has_one/has_many between the two models, when not necessarily…
-
0
votes1
answer21
viewsA: Rspec - Feature test failing because elements are not rendered in test execution
Solved. When we run our tests, the test database is accessed, not the development database. The solution was to instantiate all objects that were used in the Feature test:…
-
1
votes1
answer21
viewsQ: Rspec - Feature test failing because elements are not rendered in test execution
I have a test Feature failing because the moment it runs some HTML elements (<li data-podcast>) not yet rendered. Does anyone know how to fix it? RSpec.describe 'Podcasts List', type: :feature…
-
3
votes1
answer45
viewsQ: Use closure as return of a function
I need to use a variable of a closure as a return to the function to which this closure is nestled. How can I do this? response must be the return of ajaxRequest(): function ajaxRequest(type, url) {…
-
2
votes1
answer3951
viewsA: How to get the coordinates/position of the mouse cursor, in javascript?
You can capture this with an Event Listener: document.querySelector('body').addEventListener('mousemove', function(event) { var posX = event.clientX, posY = event.clientY; });…
javascriptanswered Luan Vicente 314 -
0
votes1
answer243
viewsA: Cannot read Property 'nodes' of Undefined
I found out what the problem was: just the name of the directory where the project was. There was a # in the folder name and this was confusing the node to find the Imports in the css files.…
-
0
votes1
answer243
viewsQ: Cannot read Property 'nodes' of Undefined
I’m getting the ERROR below when trying to implement a stylization in my project with Stylus. The same goes for background: url(...); and I think for any other attempt related. I found in the Github…
-
2
votes2
answers1652
viewsQ: Send specific branch with Git to Github
how I can send a specific branch to Github through Git? I am creating a project to learn how to use Gulp and its plugins, and in it I created a folder with source code, called src and a folder…
-
0
votes0
answers51
viewsQ: PHP-friendly URL with htaccess
Good morning, I am creating a simple system in PHP to learn more about MVC. Would you like to retrieve from the URL the information contained in '?pag='. How to do this? I need to change my file…
-
1
votes2
answers2015
viewsQ: Generate rows of a table with different colors with repeat loop
How to generate rows of a table with different colors? Each time the loop is executed generate a row with a predetermined color? Ex.: foreach ($data as $key) { echo '<tr>'; echo '<td>' .…
-
2
votes2
answers1445
viewsQ: How to insert $_POST in HTML form input?
How to insert a $_POST in a input of a form HTML? In a simple login form, when leaving a blank field, the script rescues the filled field, keeps it filled, and informs the empty field error, so that…
-
0
votes1
answer75
viewsQ: Procedural code rewriting error for OOP
The archive wishlist.php available in GIST should, through file methods db.php, perform actions of CRUD and print on the screen the obtained results, but nothing is printed. Likewise the file…
-
0
votes1
answer1676
viewsQ: OOP PHP - Simple CRUD and Creative Block System
I am studying Object Orientation applied to PHP and I am getting lost in the basics; it does not enter my mind how to organize scripts and classes. I studied Java OO and I have no major problems,…
-
1
votes2
answers4206
viewsQ: Fields aligned in form
Good night, I used float: right;' to put some fields of a form side by side, but they descend a field below. 'Full Name' and 'Date of Birth' should be side by side, but the date field goes down.…
-
5
votes2
answers1291
viewsQ: Fields are not 'masked' with jQuery Masked Plugin
Good afternoon, @EDIT The fields are now accessible. However, what is typed is not masked as preset in the script. Plugin: http://digitalbush.com/projects/masked-input-plugin/ Code: <!DOCTYPE…