Questions tagged as 'ruby-on-rails'

1
answer

How do I update a list after the action of a remote form with AJAX?

I'm having a problem I've never had in Java but I'm almost going crazy in Rails. I'm developing a project where there are users and groups. So I created a separate model for N:N relationship between users and groups. In the group show...
asked by 03.02.2014 / 19:44
3
answers

Problems with belongs_to when using Ajax in Rails 4

I have three models in my application, Order , Product and Items . Within Items I have the following code: class Item < ActiveRecord::Base belongs_to :product belongs_to :order end I have a form where I ad...
asked by 12.02.2014 / 00:52
1
answer

Defining a tree structure in ruby on rails

I'm developing a system in ruby on rails, and I'm stuck on one issue. My question is this: I need to create a tree, and then create my 'no' object and I would like it to have a 'no' parent and a 'no' child list. I tried the following approach:...
asked by 15.06.2017 / 19:56
2
answers

Carrierwave - destroy object only after it has been deleted from my storage

Carrierwave only deletes the 'mounted' file after the object in the database has been removed: after_commit :remove_avatar! :on => :destroy link I'm implementing a BackgroundDestroyable concern and for this I have a worker deleting...
asked by 13.03.2014 / 22:24
1
answer

How to do multiple image uploads with Rails 3?

I created a scaffold with the name "property", I need to add images next to it preferably in a different model referencing (1 property can have many images), where the user can select more than an image. The idea would be to create a button...
asked by 21.02.2014 / 13:39
1
answer

Passing parameters to the as_json method

I'm trying to pass parameters to the as_json (overwriting method) method in my model. Because only with the date that comes from the user I can return my result. According to that past date I add a field to the return json. We can call "new_valu...
asked by 16.03.2014 / 07:02
1
answer

Test boot time in Ruby on Rails

In Ruby on Rails, using the Minitest library, the runtime of the tests is fast. But the boot time before each rake test (...) is very annoying. Is there any way to make it faster? Update I tried to install Spring here ( gem 'spri...
asked by 06.05.2014 / 15:47
1
answer

Problems running only one unit test on rails 4

When I run all tests or just tests of a file it is working normally, but when I try to run only a single test, it just does not spin. I have this test require 'test_helper' class UserTest < ActiveSupport::TestCase test "is ban" do...
asked by 11.06.2014 / 04:06
2
answers

Updating the Header with JQuery after reloading the page

I have a Rails partial to load my header on all pages .. _header.html.erb: <ul class="nav navbar-nav"> <li><%= link_to "Home", root_path %></li> <li><%= link_to "Top Itens!", itens_path %></li>...
asked by 09.05.2014 / 03:18
1
answer

synchronize two screens

I'm starting to develop a rails calendar system and I have the following problem: Let's say I have two screens open in the calendar: 1.1 - First screen is opened on the doctor's computer. 1.2 - Second screen is opened on the secretary...
asked by 08.04.2015 / 14:47