similar to: route problem

Displaying 20 results from an estimated 1000 matches similar to: "route problem"

2012 Oct 18
0
unexpected return (LocalJumpError) only when executing this code within autoloaded classes?
Posted on stackoverflow but no traction yet: http://stackoverflow.com/questions/12942505/why-does-using-set-trace-func-work-in-some-places-but-cause-unexpected-return-l The following is a generified part of the code in a gem I''m working on: module SomeModule class << self attr_accessor :procedure def log_events(*args) args.flatten!
2012 Jan 26
2
Problem while creating new resource on ActiveAdmin
HI All, I have installed the Active Admin successfully, but facing the following error while restarting the server after generating an resource. *rails generate active_admin:resource item* /home/logs/Desktop/training/RAILS/courier/app/admin/items.rb:1:in `<top (required)>'': uninitialized constant Item (NameError) from
2012 Jan 23
0
Problem loading modules through ActiveSupport on_load
Working with modules to group certain methods. Currently I have this set up and it works: **# app/models/a.rb** class A has_history end **# lib/history.rb** module History module Model def self.included(base) base.send :extend, ClassMethods end module ClassMethods def has_history(options = {}) send :include,
2012 Sep 16
1
“Routing Error No route matches {}” when omniauth failed on registration
(Original question was asked here: http://stackoverflow.com/questions/11506734/routing-error-no-route-matches-when-omniauth-failed-on-registration ) I am using omniauth-identity and configure its "fail on registration". My files: config/initializers/omniauth.rb OmniAuth.config.logger = Rails.logger Rails.application.config.middleware.use OmniAuth::Builder do #... provider
2012 Oct 17
2
autolog: set_trace_func without all the typing
If it helps anyone developing Rails, apps, or gems, I wrote a shortcut for set_trace_func, so next time you want to just add a line before and after some function you are trying to debug you can have Ruby temporarily output every line, method, etc. executed. Also, it lets you define the format, use other loggers, etc. via a proc/lambda define, since you might not like the default format.
2012 Oct 11
4
what;s the right url in this case
Hello, I have this models class Berichten < ActiveRecord::Base attr_accessible :bericht, :user belongs_to :user belongs_to :Category end class User < ActiveRecord::Base attr_accessible :email, :name has_many :berichten end class Category < ActiveRecord::Base attr_accessible :id :name has_many :berichten end What I wonder is what the right url is when I want to place a
2012 Mar 07
0
LoadError: Expected X to define on gem upgrade
I''m upgrading to the latest version of ActiveAdmin and am running into the following when trying to start the app: Expected ../app/model/store/base.rb to define Base base.rb defines base like: module MyApp class Store::Base end end I''ve done some digging and found that ActiveAdmin did some refactoring to derive everything from a BaseController. It also depends on
2011 Oct 11
5
Polymorphic association with Active Admin
I have a belongs_to polymorphic association and I don''t know how to create and edit my models of that relationship with active admin. If anyone can help me, please do. Thank you, Rodrigo -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to
2010 Mar 27
2
Shorter Rails 3 routes
Hi, I have a small blog application, and I would like to shorten its routes. Here they are: Blog::Application.routes.draw do resources :categories do resources :articles do resources :comments end end A rake routes command produce the following lines: GET /categories/:category_id/articles/:article_id/comments(.:format)
2012 Jan 29
0
ActiveAdmin: Nested attributes not working for STI
HI All, I am having Model "Customer" using STI for sender and receiver, and i am unable to save the both sender and receiver by nested attribute. Below are my model and active admin resource codes, correct me if i am wrong nested attribute on concept. CUSTOMER MODEL: class Customer < ActiveRecord::Base belongs_to :sender, :class_name => "Customer" has_many
2010 Aug 15
1
Can save object via console, but not in app's controller
My app has a ''page'' model and a ''category'' model. ''Page'' belongs_to :category. ''Category'' has_many :pages. From the console I can create and save a page object with no problems: >> p = Page.new #<Page id: nil, title: nil, body: nil, created_at: nil, updated_at: nil, published: nil, read_counter: nil, category_id:
2006 Aug 19
3
Special ruby language for describing sql conditions
I was brainstorming today about a smooth way to define conditions in an sql query, when the numbers of attributes increase, so does the uglyness. So instead of passing a hash, I thought you could specify the conditions directly in code. I hacked together some example code which actually turned out to work. The result is concise and pretty beutiful. def search(params) Ad.find(:all) do
2013 Mar 07
0
custom table_name for table users with devise
Hi for my app, I have several tables for users (franceusers, belgiumusers, ...) and I would like to use one or another depending on domain I tried with table_name_prefix and table_name but it seems to not work class User < ActiveRecord::Base rolify # Include default devise modules. Others available are: # :token_authenticatable, :confirmable, # :lockable, :timeoutable and
2008 Jun 10
5
Rails params parsing bug?
I have a form that sends the following query string to my Rails controller: transaxion[category_association_attributes][][category_id]=2& transaxion[category_association_attributes][][amount]=12& transaxion[category_association_attributes][][category_id]=1& transaxion[category_association_attributes][][amount]=8 But ActionController parses it as:
2006 Jul 07
0
has_many relation handling
Hello, please have a look at this: My tables: create_table :languages do |t| t.column :name, :string, :limit => 3 t.column :title, :string, :limit => 30 end create_table :categories do |t| t.column :category_id, :integer (3.) t.column :created_at, :timestamp t.column :updated_at, :timestamp end create_table :categorytranslations, :id
2005 Nov 11
0
Possible to simplify these routes?
In my routes.rb I have: map.connect ''items/category/:category_id/order/:order/page/:page'', :controller=>''item'', :action=>''list'', :requirements => {:category_id => /\d+/} map.connect ''items/category/:category_id/order/:order'', :controller=>''item'',
2005 Nov 22
11
Building a conditions clause (for find) of multiple optional params?
I want to be able to find items according to various params - category_id, member_id, type_id, rating, etc. What I have now is something like: if(@params[''category_id'']) @items=Item.find(:all, :conditions=>["category_id=?", @params[''category_id'']) elsif(@params[''category_id''] and @params[''member_id''])
2006 Sep 26
0
some help with functional testing of nested routes
I have the following functional test in test/functional for testing my products_controller: require File.dirname(__FILE__) + ''/../test_helper'' require ''products_controller'' # Re-raise errors caught by the controller. class ProductsController def rescue_action(e) raise e end end class ProductsControllerTest < Test::Unit::TestCase fixtures
2006 Jul 30
1
Doubt on composite index
The AWDwR book has the following: add_index :categories_products, [:product_id, :category_id] add_index :categories_products, :category_id The first, composite index actually serves two purposes: it creates an index which can be searched on both foreign key columns, and with most databases it also creates an index that enables fast lookup by the product id. The second index then completes
2008 Nov 10
3
to_xml and helper methods
Hi, I have an array with objects and I want to generate an XML like: <objects> <object> <category_id>1</category_id> <helper-method>result 1</helper-method> </object> <object> <category_id>2</category_id> <helper-method>result 2</helper-method> </object> </objects> The helper