Questions tagged as 'ruby-on-rails'

1
answer

How to share methods between presenters in Ruby on Rails 4

I would like to add methods to my template through a Presenter, but some methods are shared among other presenters. Ex: os métodos 'pode_ser_mostrado?', 'pode_ser_editado?', 'pode_ser_excluido?' What is the best way, to create a base pres...
asked by 18.01.2015 / 05:11
1
answer

How to create a new associated template in rails

Assuming I have the Admin user, Admin has login_user , as system_user , this relation is polymorphic, since other types of users also have login_user . When creating the Admin form, I should add the fields of login_us...
asked by 21.01.2015 / 00:38
1
answer

Error when using Refile + AWS SDK

gem "mini_magick" gem "refile", require: ["refile/rails", "refile/image_processing"] gem "aws-sdk" My config / initializers / refile.rb file require "refile/backend/s3" aws = { access_key_id: ENV['S3_ACCESS_KEY'], secret_access_key: ENV...
asked by 16.02.2015 / 17:16
1
answer

Resize images with the gem Refile

Is it possible to resize, look in the documentation, and see nothing about it? Put in several sizes. Gem carrierwave has this option     
asked by 10.03.2015 / 21:41
1
answer

How do I create DESTROY link with Slim?

I'm starting with Rails, and I'm not able to create a link to delete a "post" from the site. Follow the links new and edit p.btn = link_to "Editar informações", edit_property_path(@property) if current_user == @property.user...
asked by 04.12.2014 / 21:00
0
answers

Error unefined method acts_as_authentic for main: Object

My application worked very well until today, but now when I start it it has this error:    error unefined method acts_as_authentic for main: Object Here is my code for act_as_authentic in the user model: acts_as_authentic do |c|...
asked by 29.10.2014 / 20:26
1
answer

Define the size of a field in the migration

How do I set the size of a field of type string in a migration? Ex: class CreateRooms < ActiveRecord::Migration def change create_table :rooms do |t| t.string :title t.string :location t.text :description t.timestamps end end end...
asked by 16.10.2014 / 05:31
1
answer

Adding multiple phones on a telephone_field in rails

I'm doing a customer registration here for the store and it turns out that some customers have more than 2 phone numbers the system already works with two fixed and one mobile phone fields: <%= f.label :telcelular , "Tel. Celular" %> <...
asked by 03.09.2014 / 17:25
1
answer

Keep style while strip link_to

I'm having trouble maintaining the style of a button by removing link_to and holding only the raw: =link_to(raw("<span class='calsse'></span>"), rota) To: =raw("<span class='calsse'></span>") When I do this the...
asked by 16.09.2014 / 16:22
0
answers

Rails 3 does not show ruby debug page 1.9.2

My rails project no longer shows the debug page after I changed the machine project. How do I make that page appear again?     
asked by 27.02.2015 / 21:51