similar to: has_many in routes.rb

Displaying 20 results from an estimated 70000 matches similar to: "has_many in routes.rb"

2010 Mar 23
1
:has_many and :controller specified in routes.rb
Have an app using older version of Rails (2.3.2) that I need some routing assistance with if anyone has a minute. The app was originally designed to be purely html view, and an xml and json api was hacked on. To keep it clean, we are now moving the first version of the api (v1) under its own directory (v1) under app/ controllers but still responding to the old paths. One of the parts of the new
2009 Oct 23
4
error: nested-routes with nested-model having foreign keys
Hi, I have this Test, User and Project models where every test belongs_to a project and project has_many tests. Test also belongs_to User as ''owner''. Then i followed railcast#139 to create nested route as - map.resources :projects, :has_many => :tests But somehow i get this error when url is ''http://127.0.0.1:3000/ projects/1/tests'' in
2008 Jun 16
2
call_backs Is it?
Hi I have the models 1.ServiceDeskTicket with fields id --- number --- service_desk_status_id -- created_on -- updated_on etc 2.ServiceDeskActivity with fields id -- service_desk_ticket_id -- description -- created_on -- updated_on 3.ServiceDeskAttachment id -- service_desk_ticket_id -- attachment -- created_on -- updated_on Relations as ServiceDeskticket has_many
2007 Aug 25
4
REST routes :has_many , new style
I am trying to write a nested route ''new style'' map.resources :franchises, :has_many => :documents in place of the : map.resources :franchises do |franchises| franchises.resources :documents, :name_prefix => "franchise_" end but get an error : no route found to match "/franchises/1/documents" with {:method=>:get} running rake routes,
2014 Jun 06
1
Re: Libvirt Python Bindings - Remote Connection using openAuth.
Martin, What do you mean by libvirt credentials...? -Sijo On Fri, Jun 6, 2014 at 1:57 PM, Martin Kletzander <mkletzan@redhat.com> wrote: > On Fri, Jun 06, 2014 at 01:06:55PM +0530, Sijo Jose wrote: > >> Hi, >> I am using libvirt with python binding, and I want to connect to a remote >> host. >> I was able to connect after making ssh certificate, but It
2008 Dec 13
3
session In the model
Hi i have the model SDTicket which has a field modified_by_id and it has to take data from session[:id] Now this SDTicket model has many associated models like Activity one of them So when ever an activity happens then also the value in session[:id] is to be go to modified_by_id field SDTicket has_many activities Activity belongs to SDTicket So for that what I am trying is in Activity
2008 Mar 12
2
nested routes with a 2-way has_many using join table?
I have two classes, InstructionalObject and Assets. They both have_many of the other, implemented through a join table (so it''s like a habtm without the habtm). For the next version of our app, we''re refactoring to RESTful, and i''m having trouble with my nested resources/routes. I tried this, in routes.rb: map.resources :assets do |assets| assets.resources
2009 Jun 02
3
valdate_presnce_of email, :if => :validate_id + Factory girl
Hi In the model I have User attr_accessor :validate_email_id validates_presence_of :email ,:if => :validate_email_id Could anybody please tell me how can I define a Factory for the above? Thanks in advance Sijo -- Posted via http://www.ruby-forum.com/.
2014 Jun 06
0
Re: Libvirt Python Bindings - Remote Connection using openAuth.
On Fri, Jun 06, 2014 at 01:06:55PM +0530, Sijo Jose wrote: >Hi, >I am using libvirt with python binding, and I want to connect to a remote >host. >I was able to connect after making ssh certificate, but It is not >applicable for my project. >So I want to use openAuth() method, but I could not succeed connecting to a >remote host using it. > >Here is my code
2014 Jun 06
2
Libvirt Python Bindings - Remote Connection using openAuth.
Hi, I am using libvirt with python binding, and I want to connect to a remote host. I was able to connect after making ssh certificate, but It is not applicable for my project. So I want to use openAuth() method, but I could not succeed connecting to a remote host using it. Here is my code ------------------------ import libvirt USER = "root" PASS = "mypasswd" def
2008 Dec 02
0
Best route for has_many subrecords
Hello all, I have a model, say it''s called Person, which has_many Responsibilities. I would like the "show" view for the person controller to list all of the responsibilities for that person. (That''s the easy part -- I think I know how to do that part.) At the end of the list, I would like to include a text field into which a new responsibility may be added. What
2008 Sep 19
3
create Graphical charts using rails
Hi Could anybody please point me to some good links to draw Graphical charts using RubyOnRails and also suggest which is the best one? Thanks in advance Sijo -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group,
2009 Mar 14
2
Pobrem with REST routes
Hi first at all sorry if mu english is not the best. I have this models: Encuesta->titulo and description are string. Encuesta has_many :preguntas Preguntas-> texto is string, encuesta_id and orden are integer. Pregunta belongs_to :encuesta and has_many :soluciones Soluciones-> texto is string, pregunta_id and orden are integer. Soluciones belongs_to :pregunta Routes: map.resources
2008 Jul 11
1
Using custom routes to handle new nested resources
I have a couple of resources, one nested in the other, such that my resource spec in routes.rb is: map.resources :parents, :has_many => :children This will generate a route for a new child that assumes that the parent has already been saved, something like: /parents/:parent_id/children/new But what if I want a route that handles the case where the parent resource is also new, and thus
2008 Jan 27
4
(REST) Nested routes
Hello, I''m in troubles with nested routes. I have three models: Team, Tournament and TeamTournaments class Team < ActiveRecord::Base has_many :tournaments, :through => :team_tournaments has_many :team_tournaments class TeamTournament < ActiveRecord::Base belongs_to :team, :foreign_key => ''team_id'' belongs_to :tournament, :class_name =>
2006 Dec 05
1
has_many :through questions
I have a database with 4 tables Months has_many :weeks Weeks has_many :days Days has_many :hours Hours Weeks belong_to :month Days belong_to :week hours belong_to :day I need to access the month_id in the Hour.rb model. find(:first, :conditions => ["user_id = ? AND month_id = ?", user_id, month_id]) Thanks -- Posted via http://www.ruby-forum.com/.
2008 Jun 06
2
joining tables
Hi I have 3 tables as 1) user_groups id | contact_id | group_id | group_user_type_id 2) contact id | name_first | name_last | 3)contact_email_addresses contact_id | contact_email_address_type_id | emailaddress Now I have group_id sa for example 68 What I want is from contact_email_addresses table get all the emailaddress with contact_email_address_type_id=2 for the contacts
2008 May 13
4
calling another rjs file in an if condition
Hi I have a controller action like below.This def is called by a submit_to_remote def edit_service_desk_status_after_transfer if params[:transfer_reason].empty? #This is used in the :failure of submit_to_remote else @sd_ticket = ServiceDeskTicket.find(params[:sd_id]) ActiveRecord::Base.transaction do @sd_status_history = ServiceDeskStatusHistory.new
2008 Jul 21
2
using image with submit_to_remote
Hi How can I give an image to submit_to_remote .I could successfully do it with link_to_remote as below..But the same not working with submit_to_remote <%= link_to_remote( image_tag("/images/cancel.png", {:alt => ''Cancel'', :class=>"noborder",:title=>"Cancel"}), {:update => "search_contact_div", :url
2006 Feb 21
7
has_many :through failing to save changes
Hi all, I''m messing around with has_many, and has_many :through (on edge rails), using a join model. Branches and Projects join through ProjectsAtBranches. If I do @branch.projects, I can see the associated projects, and visa-versa, if I manually put them in the join table. But I cannot do @branch.projects << Branch.find(blah), or @branch.projects.clear, and then save the