Questions tagged as 'ruby-on-rails'

3
answers

Using Services to vailidar + ruby on rails

I'm trying to create a service that will check if a user exists class UserService def create_user(user_username, user_email) if User.find(user_username) false end if User.find(user_email) false end true end...
asked by 13.01.2016 / 21:55
2
answers

select_collection in Ruby on rails

If I want to return the Active and Inactive options for me to select, I use the following code in the view, so it returns the 2 statuses: > <%= select(:student, :status, Situation.all.collect { |c| [ c.descricao, c.id ] }) %> But I...
asked by 14.09.2016 / 15:43
2
answers

Build an unordered list with content_tag

How to build a list containing sublists using content_tag f% of Rails? Using the method in Helper does not work. <ul class="menu"> <li>Item1 <ul> <li><a href="#>Link1</a></li> <li><...
asked by 14.01.2015 / 19:02
1
answer

Error rake db: create

Good afternoon, I am using a program from another person developed in Ruby on Rails and after giving bundle install to the project folder and installing all gems , I tried to create the database through the commands: rake d...
asked by 24.06.2015 / 21:27
1
answer

Humanize in accented characters

I have the following problem, I have some error messages on my system, but when there are accents in the messages, the humanize does not apply to these characters, I tried to use the gem 'brazilian-rails' , but since it is discontinued, so...
asked by 30.09.2014 / 16:13
1
answer

Best way to return data entered by a select of constants

I have a Usuario template and for it I have two constants that define a type for it. To pass this information to a select I have a type method that returns a Array . Ex: #models/Usuario.rb class Usuario < ActiveRecord::B...
asked by 13.03.2014 / 15:48
3
answers

Internationalization of bg-image by CSS

I have a project in Rails that needs different images for each language, however and image is pulled from CSS and I can not change it. How to change the image according to the chosen language? background: url("/caminho/imagem.jpg"); edit:...
asked by 11.09.2014 / 21:35
2
answers

Asynchronous Process in Ruby on Rails

I have a process that makes a match between the items [books, movies, songs and games] of a certain user on Facebook with the items registered in my database. The problem is that the whole process takes around 18 ~ 25 seconds and I would not w...
asked by 01.06.2014 / 02:59
2
answers

How to update Gem on windows?

My problem is that I can not update the gem I downloaded rubyInstaller I tried to run the command to update: gem update rails --no-document But unfortunately does not update gives the error: gem update rails --no-document...
asked by 03.11.2016 / 14:34
1
answer

Rails Weekly 5

I need to implement a simple calendar in Rails for presentation of daily schedules, I have adapted the model and the controller to add new schedules with date and time, but the difficulty is to present instead of the list as follows: I have...
asked by 27.09.2017 / 17:18