Questions tagged as 'ruby-on-rails'

1
answer

Using Ruby on Rails is it possible to execute external functions on the client side?

Example: On the computer that has the browser accessing the page, with the proper permission, execute a function on a DLL installed on it? Complementing: My intention was to use it on an intranet, and access a printer using the DLL provided b...
asked by 28.12.2014 / 22:47
2
answers

Error 500 when accessing the edit page, ruby 1.9.2, rails 3.2.13

I have an application in rails that immediately after loading the edit.html.haml page rendering the layout gives me a 500 error, the table in the DB has only one record and is linked to another table (credentials / authorization system) I'm runn...
asked by 23.02.2015 / 19:31
2
answers

How to use HATBM with various models

I will have the model Tag it will have relationship HABTM with POSTS . But I want it to also have HABTM relationship with USERS because my goal is in the future to find posts that have the same tags as the us...
asked by 01.12.2014 / 02:14
1
answer

error box vagrant

I'm having a problem with the vagrant when starting the box. When I give a vagrant up. Look at github for the bugs that occur. link Informs that it is out of date with the updated virtual box as well as the Extension Pack. After givin...
asked by 10.11.2014 / 22:29
1
answer

Request timeout with nginx, unicorn and rails

I have an application in Rails that runs with unicorn in production. Some calls take a long time to process. I configured the server to increase the timeout so that the server does not respond in error. The problem is that if the request takes m...
asked by 11.11.2014 / 20:51
2
answers

Form to change variable for a calculation in the same view

I'm starting with Rails. I have a view that receives information from the database and through methods of a model make several calculations. For example: <% @profundidade = 0.5 %> <% @prnt = 90 %> <% @analises.each do |a...
asked by 28.02.2015 / 02:57
1
answer

Rails 4 select Uniq

I have the Items table: id enrollment_id turma_id 11 2 2 12 2 3 13 2 2 14 2 2 15 2 3 I want my result to be this: id enrollment_id turma_id 11...
asked by 18.11.2014 / 18:21
1
answer

Partial does not render with 'enter' using Ajax

I have an ajax that fires when the page loads: /assets/javascript/itens.js : if ($('#content-recommendation').length) { xhr = $.ajax({ url:'/get_recommendations/' + gon.item_id + '.js', type:"get" }); } views/items...
asked by 01.09.2014 / 03:39
1
answer

Redis in Rails 4

I have an Item template. Can you save Item.all (Item :: ActiveRecord_Relation) in Redis? I tried to do so: $redis = Redis::Namespace.new("suggestme", :redis => Redis.new) $redis.set("itens", Item.all) But when I give: $redis.get("iten...
asked by 25.08.2014 / 22:27
1
answer

How to display a user's posts?

I'm trying to display user posts in perfil = link_to 'perfil', user_path(user) The user data appears, but when I try to show user posts the error occurs:    NoMethodError in UsersController # show undefined method 'posts'   for # &l...
asked by 20.01.2015 / 23:03