Skip to main content
Filter by
Sorted by
Tagged with
0 votes
2 answers
837 views

I have three tables: Staff Staff_locations Locations Business case: Staff can work in multiple locations. Association between Staff and Location is done through staff_locations table. While creating ...
Michal's user avatar
  • 3
1 vote
2 answers
320 views

I have product as active record table and option_type as activemodel model. option types is an array of objects as follows, [ {name: 'color', values: ['red', 'blue']}, {name: 'size', values: ['...
Hemant Patil's user avatar
0 votes
1 answer
159 views

class CustomerType < ApplicationRecord belongs_to :workspace, inverse_of: :customer_type validates_presence_of :workspace end class Workspace < ApplicationRecord validates :name, presence:...
Cephas's user avatar
  • 57
2 votes
1 answer
374 views

<%= form_for [current_user, @task] do |f| %> gives users/:id/tasks but I would need users/:slug/tasks as I am using: resources :users, param: :slug do resources :tasks, only: [:index, :new, :...
user3755529's user avatar
  • 1,206
0 votes
2 answers
701 views

I have Categories (Parents) within which are listed Products (Children). I want to be able to create a new Product directly from the navbar, anywhere in the app and then, during the creation, assign ...
Istvanlaz's user avatar
1 vote
1 answer
461 views

I have a form that I'm using for both new and edit. The form has fill-ins for product name, description, etc. Also, the user can either select an item from the nested drop down (collection_select), ...
user avatar
0 votes
1 answer
308 views

So I have a user form form_for that accepts nested attributes from account_prices. Whats happening is on my user controller I have this private method. def pre_build_user_account_prices if @...
aRtoo's user avatar
  • 1,874
0 votes
2 answers
67 views

I am making an events app where each event can have multiple to do lists each with their own tasks. I am struggling with the third level nesting of the tasks (todo_items) Here are my models: Event....
Ryan Neill's user avatar
2 votes
2 answers
3k views

Issue: I have a nested fields_for text_field not appearing, I am not sure what I have been done wrong. Goal: While creating a record, iterate through a model with preset variables, and save a file (...
uno's user avatar
  • 1,471
0 votes
2 answers
291 views

I'm using this to build a form model (i want to create a Transaction and an Address, and the address must belong to the transaction). I'm getting a rails wrong number of arguments (given 9, expected 0)...
calyxofheld's user avatar
  • 2,298
0 votes
1 answer
113 views

I have a User, Meeting, and Club Model. A User has_many :user_clubs, has_many :clubs, :through => :user_clubs. A Club has_many :user_clubs, has_many :users, :through => :user_clubs, and has_many :...
Austin Burke's user avatar
0 votes
1 answer
173 views

I use the nested_form_fields gem to tranlsate some specific fields in a technical document. Translations are nested fields associated to the document, so that each document has one instance of ...
user1185081's user avatar
  • 2,178
3 votes
1 answer
2k views

I want to create a question list, to decide that question has multiple correct answer or not, I use a checkbox field: <div> <%= ff.label :multi_correct, t(".multi"), class: "field-label" %&...
manh.vu's user avatar
  • 636
0 votes
0 answers
167 views

I have the following nested form in my product_models/new.html.erb <%= f.simple_fields_for :product_category do |g| %> <%= g.input :name, placeholder: "Category name", label: "Category", ...
Augusto Carmo's user avatar
2 votes
1 answer
341 views

In my product_model_controller.rb I have the following code for the strong params: def product_model_params params.require(:product_model) .permit(:name, :product_category_id, ...
Augusto Carmo's user avatar
0 votes
2 answers
665 views

I am trying to remove the label that is auto included when we use '.association' of the simple_form_for. But, regardless of what I do, the title and its <hr> continue to be displayed. I tried: ...
Augusto Carmo's user avatar
0 votes
2 answers
507 views

I'm new to rails- but now wondering, are Rails validations lost on model objects when in my form I'm trying to create both the child and parent at the same time? In my example (models in bold) 1 - ...
jimgug's user avatar
  • 175
0 votes
2 answers
207 views

I would like on the form page for a campaign for a user to be able to create cities as well. I followed http://railscasts.com/episodes/196-nested-model-form-part-1?view=comments and https://medium.com/...
Daniel Rusu's user avatar
0 votes
0 answers
66 views

So I have a basic sign up, sign in site with username and password. I don't want to use recaptcha and was wondering whether i can create my own? So have for example 'what colour is an orange'. I ...
john seymour 's user avatar
0 votes
1 answer
28 views

I've got a User who's got multiple UserAddress When I use : <%= f.fields_for :user_addresses do |f| %> My hash is nice : "user_addresses_attributes"=> {"0"=>{"default"=>"0", "...
Yann Froment's user avatar
0 votes
1 answer
87 views

I'm new do rails and MVC. I'm trying to save to my database a nested form that I made using simple-form and nested-form-for gems. When I submit the form only the 'parent' model is created and saved. ...
tanaka's user avatar
  • 401
1 vote
2 answers
1k views

The following is my model structure role.rb has_many :user_roles has_many :users, through: :user_roles has_many :companies, through: :user_roles user.rb has_one :user_role, dependent: :destroy ...
wish's user avatar
  • 43
2 votes
0 answers
579 views

I'm using 'nested_form_fields' gem to build Rails form. It does work but not in the right way. When I click the delete button, the fields are all deleted at once. (When I add three text_fields, and ...
yuzu.ka's user avatar
  • 21
0 votes
1 answer
230 views

I'm building a simple top-to-bottom Workout Routine app on ROR. I'm able to create a Workout Day (parent) and an Exercise (child) on the same form. But I can't seem to save the Weighted Set (...
hp001's user avatar
  • 79
0 votes
1 answer
105 views

I'm kinda new to ruby on rails, I've been reading documentation on assosiations and I've been having an easy time (and usually a quick google search solves most of my doubts) however recently I'm ...
Bluespheal's user avatar
0 votes
1 answer
1k views

I am using nested_form in my rails application. I need to add onclick event which adds first two fields and render the sum in third field. This script should run in all the nested fields. I tried the ...
poombavai's user avatar
  • 111
2 votes
1 answer
735 views

i have a rails app. i have strange problem in saving form this is my ticket model . class Ticket < ApplicationRecord belongs_to :user has_many :ticketissues , inverse_of: :ticket ...
Armanlearn's user avatar
0 votes
0 answers
581 views

I have this PostApplication Model and PostApplication has_many Documents in this below activeadmin resource which contains has_many form. I want to show various records of Document model based on the ...
Rishabh's user avatar
  • 75
0 votes
1 answer
83 views

I have a form where teams can register for a tournament. The form saves & routes as expected when I first save the form, however if I return to the root_path & repeat the process of ...
afishintaiwan's user avatar
4 votes
4 answers
2k views

Ok folks, Rails 5 has really had its nuances differing from Rails 4. What I have going on is that every time I click the submit button on the form it reloads with the error Profile user must exist and ...
The Gugaru's user avatar
0 votes
1 answer
56 views

Ok so I had this issue with one to one relationships and I am going to figure that it is a similar issue with pluralization. I have tried to put in @payment.profile_notes.build and it still does not ...
The Gugaru's user avatar
0 votes
2 answers
381 views

I have the following models: class Person < ApplicationRecord has_many :interests, dependent: :destroy accepts_nested_attributes_for :interests validates_presence_of :email ...
MLZ's user avatar
  • 443
0 votes
2 answers
590 views

I have the following Rails models that communicate through a many-to-many relationship: class Task < ApplicationRecord belongs_to :case has_many :task_actor_roles has_many :task_artifacts ...
Leandro's user avatar
  • 377
0 votes
1 answer
421 views

I built a form_for with 4 associated models. I created nested fields_for which can be added dynamically with the code below. My form works if I call the 'edit' method but if I use the method below to ...
Bolic's user avatar
  • 775
0 votes
1 answer
152 views

I am having trouble using the form_for correctly for my nested resources. I have the following set up in my models: team.rb class Team < ApplicationRecord has_many :superheroes ...
Lily Brown's user avatar
0 votes
1 answer
641 views

I have Test model and User model. Test model is having many users. Test controller is as below. class TestController def create Test.create(testparams) end private def testparams ...
rohan kharvi's user avatar
0 votes
2 answers
852 views

I have the following models and relations: Rate fields t.string :type t.string :name class Rate < ActiveRecord::Base has_many :category_rate_requests end CategoryRateRequests fields t....
fedest's user avatar
  • 1,402
1 vote
0 answers
2k views

Please forgive me if this is a simple question. I've spent some time searching SO and have not fund a clear answer for this question. I'm also new to rails. I have a regular old many to many ...
maitland's user avatar
1 vote
0 answers
90 views

I use gem 'nested_form' in rails 3.2 Models: meeting_agenda.rb: class MeetingAgenda < ActiveRecord::Base has_many :meeting_questions, :inverse_of => :meeting_agenda ...
Александр Парамонов's user avatar
1 vote
1 answer
1k views

I am having some trouble figuring out how to upload multiple images using a single form in a view. Basically, I have a form for articles on a blog that consists of a title text_field, a body text_area ...
Frazer Watson's user avatar
3 votes
1 answer
645 views

I want a form to edit a single new child object and the parent object in one go (in a has many relationship). If I create a new child in the controller with @child = @parent.children.new, the ...
Tim Koelkebeck's user avatar
0 votes
1 answer
4k views

Hoping someone can help out with this. I have two models order and date_order. Each order can have multiple date_orders, and I should be able to create many date_orders as I create an order. How do I ...
Guilherme Nazareth de Souza's user avatar
0 votes
1 answer
83 views

I've been struggling to get my nested form to save the users' inputs. The "outer" form saves the information perfectly. The "inner", or nested, one creates a new object, and passes hidden-field ...
Guilherme Nazareth de Souza's user avatar
0 votes
2 answers
241 views

I'm trying to save a form_for with nested resources that inputs data into a model that belongs to 2 other models and has 2 foreign keys: User_id and listing_id. The problem is that only the user_id ...
cremboeye's user avatar
0 votes
1 answer
275 views

I have a post model that belongs_to a category model. The post resources are nested under the category resources. I'm building out a form_for @post to create a new post. However, I'm getting the ...
heyitsjhu's user avatar
  • 1,011
1 vote
1 answer
926 views

The model "Formula" has many "Operands" created using a simple_nested_form, using fields for. It seems the process is correct, and no errors launched, but operands are not saved. Formula model: ...
Prade Mismo's user avatar
0 votes
1 answer
543 views

I am trying to dynamically add an arbitrary number of ingredients to a shoppping list using the nested_form gem. This is a has_many through relationship, and I'm having trouble finding exactly what I ...
Paul Morris's user avatar
1 vote
1 answer
1k views

I have a User, Drinks, Gyms, Foods Model. class User < ActiveRecord::Base has_many :drinks has_many :foods has_many :gyms end I track the number of drinks a user had during the day and save it ...
Theo's user avatar
  • 45
1 vote
1 answer
411 views

The form doesn't show the Pessoa's field, what's wrong? <%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %> <%= devise_error_messages! %> <...
Elton Santos's user avatar
1 vote
1 answer
1k views

Is there a way to update a field relative to a many-to-many associations via form_for? Theses are my models: class Grad < ActiveRecord::Base belongs_to :school has_many :grad_courses ...
mknarciso's user avatar