I have a code that on my backend it returns true or false, I'm working with ruby and rails 5.
So I have it's an if or so ja:
<% if @order? %>
<h2> teste 2 <h2>
<%else>
<h1>teste 1</h1>
<%end>...
How do you upgrade a site developed in Ruby on Rails to a newer version of Rails?
For example from 4.2.4 for a possible Rails 5.0.0.
I am still a beginner in the language and framework and I was left with this doubt if for example I develo...
I was studying rails and following the link tutorial.
The steps in the tutorial were as follows, create a datatable that would make a request via json, the controller that would respond with the data and the data table would be populated....
I'm learning Ruby and am having a question about how to make a if inside the render to display param only if it exists ...
Ex:
if params[:field]
puts 'field' => params[:field],
end
How do I resolve this in this code?...
In my spec / rails_helper.rb I added the following code so that the database was automatically created when running rspec :
def database_exists?
ActiveRecord::Base.connection rescue ActiveRecord::NoDatabaseError ? false : true
end
unless...
I have the following code:
def label_file_type(type)
label =
case type.to_s
when ['.jpg', '.jpeg', '.png'].include?(type) then
content_tag(:span, 'Imagem', class: ['label', 'picture'])
when ['.mp3'].include?(type) then...
I need to add a double index to the N to N ratio of the courses_internships table. it would look something like this: add_index[:course_id, :internship_id] .
However, when I created the link table, the index was separated by the...
I need to organize my seeds.rb file, so I created a namespace where I will add my classes ex:
module Seeds
class Apple
def self.run
puts 'teste'
end
end
end
Seeds::Apple.run
This works perfectly, but I need to separate my class...
I've created a method to group all the commits of a user per month into a hash:
def calculate_month_ranking(commits)
rank = Hash.new(Hash.new(0))
commits.each do |commit_yml|
commit = YAML.load commit_yml.data
commit[:commits].e...
Problem does not send Confirmation Email and Password Change
Problem
After requesting the submission of forget password? it will load until giving time out .
Thecreationofthetokenforpasswordexchangeisgeneratedcorrectly,acce...