Tagged Questions
0
votes
0answers
22 views
Naming categories with using ancestry gem for a rails products catelogue with sections, categories, and subcategories functionality
I'm trying to figure out how to list products in categories to achieve a result similar to this:
Phones (3)
--Smart Phones (2)
----Apple(1)
----Android (1)
--House Phones (1)
Computers (4)
...
0
votes
0answers
29 views
Dynamically adding nested forms
EDIT: A simpler way to explain this would be:
At the end of railscast 197 (http://railscasts.com/episodes/197-nested-model-form-part-2) Ryan adds a question and then adds answers individually. What ...
0
votes
0answers
26 views
Rails associated model callbacks not fired
I use accepts_nested_attributes in my model parent and the parent model has belongs_to association with children model. I am trying to use callbacks in my children model (after_update, ...
0
votes
0answers
20 views
rails 3 accepts_nested_attributes_for not rejecting empty nested file_field
New to rails and I'm trying to reject an empty nested file_field but it just keeps going though. Here is the setup.
EDIT: It does actually save the image properly if one is included, just doesn't ...
1
vote
2answers
33 views
How to remove nested keys from a hash list in Rails
I am now trying for some hours to remove a nested hash key of a hash list.
I saw many solution non-nested hashs wich looks like this:
sample_hash = {"key1" => "value1", "key2" => "value2"}
...
0
votes
1answer
30 views
Nested Ressources in Ruby on Rails
It's actually supposed to be very trivial, but I'm experiencing strange issues.
I'm developing a Game Database, where Users can chart Game Entries and also write reviews to those reviews. Of course a ...
0
votes
1answer
18 views
Keeping REST on nested resource in Rails
I'm currently torturing myself with an implementation conundrum. I have a structure akin to a simple Post -> Comments nested resource relationship.
I have the facility for showing context specific ...
0
votes
2answers
82 views
How to set up a nested model with Ruby on Rails?
I'm newbie in coding, and I'm discovering RoR.
I want to create an application with Users and Products. I'm good with the Users, but I'm wondering about the architecture of the Products...
Here the ...
0
votes
2answers
37 views
How do I use except on a nested hash in a reject
I'm trying to reject an empty form entry, but I'm having difficulties.
Users can either choose for an existing location, or create a new one. I want the form to actually show empty fields, but reject ...
-1
votes
1answer
47 views
Ruby on Rails: nested each loop within while loop generates error
I get a syntax error, when I execute the following code within the rails console:
"syntax error, unexpected $end, expecting keyword_end"
range = 2
my_array = Array.new(range)
a = [1]
i = 0
while i ...
0
votes
0answers
37 views
Haml nesting with rendered partial in Rails
Consider a partial.haml like this:
- haml_tag :body, {:id => @instance_var}
What I'm trying to do is to nest haml content under a rendered partial. Something like:
= render 'partial_file' do
...
0
votes
0answers
71 views
Adding nested attributes to devise user model
At first glance it would seem this question has been answered before, but not on my case (most are related to mass assignment issues and/or mongoid.) I have not been able to find an answer even though ...
0
votes
2answers
31 views
How to ensure all nested attributes show during 'edit'
I currently have a nested model User has_many Sales_Orders has_many Items.
I can create the Sales_Order with nested Items properly but when I try to 'edit' the Sales_Order, the Sales_Order ...
0
votes
0answers
69 views
Ruby on Rails - Problems with using nested scaffolds with ActiveScaffold
I've been trying for several days to get the conf.nested.add_link to work properly in ActiveScaffold.
The scaffold does indeed appear as an action, but when I interact with it, I get redirected to a ...
0
votes
2answers
38 views
Rails3+Devise+simple_form+nested_model
I am using devise to authenticate Users, and when new User signs up, I would like to create new Account as well, and set this user as owner of the account. I decided to use form with nested model for ...
1
vote
1answer
88 views
Rails accepts_nested_attributes_for validation on transactional object
I'm struggling since some hours in order to make validations of nested attributes work in my rails app. A small caveat is that I have to validate nested attributes dynamically based off of their ...
1
vote
2answers
44 views
Rails nested_forms not displaying fields when dynamically adding extra objects
I'm currently using the nested_forms gem and I'm trying to be able to add multiple landlords to a property.
At the moment the associations are quite deep:
Property -> Landlord -> Contact_Detail -> ...
0
votes
0answers
31 views
Rails Nested Forms many relationships
I'm working with 4 forms. My models are Employee, Customer, Location and Ticket.
I am using the has_many through relation.
An employee enters a customer and location (I would like to nest these ...
0
votes
1answer
25 views
Unknown attribute when saving a nested form
I'm writing an engine with Rails 3. And I have there a generic_recipe which contains recipes like this:
module EdibleRecipe
class GenericRecipe < ActiveRecord::Base
attr_accessible :recipe, ...
0
votes
1answer
60 views
Can't get nested form to show
Below are my models:
class Ticket < ActiveRecord::Base
attr_accessible :issue, :logs_attributes
has_many :logs
accepts_nested_attributes_for :logs
end
class Log < ActiveRecord::Base
...
0
votes
1answer
34 views
Retrieve all Comments of User (deeply nested)
Thats my routing:
resources :posts do
resources :comments
end
My User class:
has_many :posts
My Post class:
belongs_to :user
has_many :comments
My Comment class
belongs_to :post
In my ...
0
votes
1answer
71 views
Nested hash and rake task
I have to load from file a lot of clients with phonenumbers
my models Clients :name
has_many :telnumbers
Telnumbers :number, :comment
So I have done rake task
desc "Loads file clients from excell"
...
0
votes
0answers
42 views
Rails : nested resources issue
I'm newbie in RoR and currently on my first app.
Ive got 3 models : Event, Place and Order
class Event < ActiveRecord::Base
attr_accessible :name
has_many :places
end
class Place < ...
0
votes
1answer
49 views
Include nested json in Rails
I added an object nested in another object using the model. Just like this:
Ingresso model ->
def as_json(options=nil)
super(:include => [:usuario, :tipo_de_ingresso])
end
In ...
0
votes
0answers
78 views
Railscasts#197: nested model form — additional fields not saving
So I have been following the tutorial and everything seemed to be going good. However, it seems that only associations that were instanced in the model were getting saved. Additional forms added using ...
0
votes
0answers
92 views
Rails joins and nested queries on 3 models
I have 3 models,
class Host
ref: string
address: string,
name: string
primary_key='ref'
has_many :rooms, :class_name=>"Room", :foreign_key=>'host_ref'
Class Room
ref ...
0
votes
1answer
109 views
Routing nested resources and matching controller
I've had a problem over the last few days getting my nested resources to create and display properly. There are tons of similar questions on StackOverflow and lots of blog posts on this, but they all ...
1
vote
1answer
141 views
Rails 3 - Nested Routes for has_many through self-referential following/follower relationships
I made such a relationship using this answer: Ruby on Rails has_many through self-referential following/follower relationships
So I've the following Models :
class User < ActiveRecord::Base
...
0
votes
0answers
34 views
updating rails nested resource
Sometimes we will give discount coupon to our customers and they use them when they starts a project. I also want to assign discount coupon to projects directly in admin panel. The following are my ...
3
votes
1answer
61 views
Nested (and Unested at-same-time) Resources better approach
I have two models like that
class Plan < ActiveRecord::Base
belongs_to :profile
And
class Profile < ActiveRecord::Base
has_many :plans
And routes like: (I need to)
resources ...