Questions tagged as 'ruby-on-rails'

1
answer

Ruby on rails - Insert a render inside an html tag

How do I add a render inside an HTML tag? For example, this works here ok : <%= render :partial => "feed/new_card", :locals => { :main_image => image_tag('feed/new_badge.jpg') } %> <div><%= main_imag...
asked by 29.12.2015 / 18:42
2
answers

Because param ["value"] is returning nothing

I am creating a project in Ruby on Rails, where I create a cry with the following route in postman: POST:http://localhost:3000/api/yells { "user_id":"1", "title":"caneca", "desciption":"beber", "yell_type":"oferta", "price"...
asked by 26.01.2016 / 18:39
1
answer

NoMethodError in User # new RubyOnRails

controller: class UsuarioController < ApplicationController def index @usuarios = Usuario.order :nome end def new @usuario = Usuario.new end def show @usuario = Usuario.find(params[:id])...
asked by 16.12.2015 / 17:31
1
answer

Post and Put with Restangular for api Ruby on Rails

I'm creating a single page application using angularjs using a ruby on rails API and the restangular to make my requests. Problem: The API by default expects POST and PUT requests to arrive in a property with the model name, eg:...
asked by 14.10.2015 / 16:15
1
answer

Access token or Sessions in APIs

I'm developing an api and I'm having a question about how to handle the logged-in user. The user's logon api and administration (add things, edit profile, photos, etc.) is developed in Rails in a single project. As I have a very interactive p...
asked by 04.12.2015 / 14:52
1
answer

How to create custom stages with Capistrano 3?

I have a repository where two different applications come from. Although they share the same source code, the visual and database of the two is different, as well as the paths on the server. Good to remember that they are treated as different pr...
asked by 05.08.2015 / 21:27
1
answer

Doubts about relationship between Rails tables

Hello, I am a beginner in Rails, (setting up my first system) and I have two doubts about relationship between tables: 1.) I have a Line template with the source and destination attributes that should reference another Local , ie Line...
asked by 03.07.2015 / 01:26
1
answer

How to leave this DRY code block in Ruby

I have this block of code here: if contract.amendments.empty? if Date.today - contract.due_date >= 30 || Date.today + contract.due_date <= 30 @start_date = contract.due_date + 1 @end_date = contract.due_date + 365 elsif Date....
asked by 15.04.2015 / 15:30
1
answer

How to model a feedback system

I'm developing an application in Rails. I would like to know how to model the comments part. There is a table for the calls (Helpdesk system), and it is related to the history table, which is the comments. My question is, how can I find out who...
asked by 02.04.2015 / 21:40
1
answer

Failed to do bundle install

Good afternoon, I'm having a little problem when I bundle install : /usr/local/bin/ruby extconf.rb *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mk...
asked by 13.04.2015 / 14:44