Posts by Bruno Casali • 566 points
20 posts
-
1
votes1
answer355
viewsA: How to generate sequential numbers automatically with current year in Rails?
@Alextakitani made good inquiries, but to respond quickly you can store it in the bank using a callback: before_create :record_code_number private def record_code_number self.your_field_table =…
-
1
votes1
answer147
viewsA: Composite index - M:N in Ruby on Rails
Your new index will be something like: (if you don’t need it to be unique, just remove the unique: true of the line). add_index :courses_internships, [:course_id, :internship_id], unique: true To…
-
0
votes2
answers162
viewsA: Problem when rendering partials dynamically
Dude I may be freaking out but are sure that @time_line is an instance variable? If it really is, it always will be nil in your context because you are calling time_line instead of @time_line!! So…
-
1
votes2
answers809
viewsA: Text field mask without using jquery
Honestly, I don’t believe there are any, because the masks should be made on the client side, and the Gems usually act on the server side. I use a Gem, but she is nothing more than the jQuery loaded…
-
2
votes1
answer452
viewsA: Retrieving values from my form
Recovering you will even recover, your problem is how to get an event in your treatment. The runat="server" in , is missing or the address of where you want to arrive with the Submit of this form.…
-
1
votes1
answer1570
viewsA: How to treat multiple Forms on the same page.aspx?
Dude, take a look at my comment too, but to answer your question is simple! Take a look at this link, that will cure your doubts! Valeuu! D UPDATE 01 You must set an action and method in the form…
-
3
votes2
answers9820
viewsA: Character string not recognized as valid datetime
look I made a test and rolled well, I noticed that it lacked the space in its concatenation! look at: http://prntscr.com/4pbep5 the Cód: protected void Unnamed_Click(object sender, EventArgs e) {…
-
1
votes5
answers13026
viewsA: Coin style in a Textbox in Winforms
There @Fabricio is very simple. System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("pt-BR"); label.Text = string.Format("{0:C}", Convert.ToDouble(1200.58));…
-
2
votes3
answers42978
viewsA: How to make a select with multiple `Where field like '%'` in C#
The SQL that is used in C# has some particularities, for you to make a query using LIKE, you should be aware of some things.. If the value won’t be null or empty "", Empty Be aware also in NEVER…
-
4
votes1
answer1537
viewsQ: Difficulties writing a user friendly (global) web config url
I asked that same question in the English version but I was unsuccessful! I have an application that will be translated into three languages en/en/es. Until then I’ll use Globalresources, I have no…
-
3
votes6
answers1555
viewsA: How to do the following query without using INNER JOIN?
set @entrada = 23; set @saida = 47; SELECT e.id_pais as entrada, s.id_pais as saida FROM tbl_pais s, tbl_pais e WHERE (s.id_pais = @saida AND e.id_pais = @entrada); I wouldn’t know any other way to…
-
1
votes1
answer538
viewsA: Problem with xampp server
Look, I’m gonna suggest something else, not solve your problem with XAMPP... PHP comes with a built-in server, meaning you don’t have to use XAMPP if you don’t want to!! D php -s localhost:7000 (if…
-
1
votes1
answer237
viewsA: SSH - Change the default session path
Hello, to do this is very simple: Open a terminal and type: gedit ~/.bashrc Open and add at the end of this file the path to your preferred directory within a command cd: cd…
-
0
votes1
answer112
viewsQ: Relationship of products in models and bank
I’ll try to be brief in my doubt. How can I model a class scheme that gives me some questions: This I will do in Rails 4.1, using Activerecord as ORM acting in Mysql. I’ll have an entity Person…
-
4
votes3
answers7017
viewsA: What is an abstraction?
What is this "abstraction"? I have learned and have in my mind the following definition: Abstraction for OO, is nothing more than you observe day-to-day behaviors and structures, and turn them into…
-
0
votes2
answers456
viewsA: Javascript files do not load in production. How to resolve?
Updatee A little guy had a taste like yours here... link To resolve it added all the files that should be loaded into production in Application.js, you could post yours ? Try that too:…
-
1
votes2
answers301
viewsA: How to return an int in a Decimal property
You can’t treat everything to decimal?? it is very dangerous to use the type dynamic, if you end up forgetting some treatment will have exceptions... I don’t know how you’re doing to read from the…
-
1
votes2
answers3816
viewsA: Fade effect of elements just by visualizing them with bootstrap
You have some site that would like to copy this fade, it is better to explain, but here are some links that can help you: mycodezone bootply - Inclusive here at bootply have several snippets of…
twitter-bootstrapanswered Bruno Casali 566 -
9
votes3
answers8297
viewsA: What are the principles DRY, KISS and YAGNI?
DRY Don’t Repeat Yourself: It is very popular in the community and for those who develop with Ruby / Rails, it assumes the fundamental principle that one should NEVER repeat something that is…
-
1
votes2
answers1051
viewsA: SQL QUERY get Average one month of a relative day of the week
I don’t have 50 points to comment on, but I could post your table structure?! SELECT avg(month(valor_do_mes)) as media_mes, avg(day(valor_do_dia)) as media_dia FROM tbl WHERE /*aí você pode…