Quantcast








     

Routing Polymorphic Requests Rails

stackoverflow.com - 2013-04-05 04:06:49 - Similar - Report/Block

In rails 3, I have several polymorphic models such as Image and Comment , so my question is, When someone makes a request to Create/Update/Destroy a polymorphic object, should the request go to a single controller for the polymorphic object CommentController , or should the request be routed to the controller of the polymorphic accessor...

Polymorphic models like rails in Django? [closed]

stackoverflow.com - 2011-03-29 16:31:20 - Similar - Report/Block

rails models by declare :polymorphic => true i could using that as Polymorphic model.. But how can i create polymorphic model in Django I know it's not just simple like doing in rails but i need some introduction for doing this in Django...

Should we use the abstracted rails polymorphic migration syntax?

stackoverflow.com - 2012-03-30 19:46:58 - Similar - Report/Block

There are two ways to write a polymorphic migration in Rails. Generally, I've done this: class CreateFeatures < ActiveRecord::Migration def change create_table :features do |t| t.integer :featureable_id t.string :featurable_type t.timestamps end end However, we can also do this: class CreateFeatures <...

Rails upload form with carrierwave and polymorphic associations

stackoverflow.com - 2013-04-13 17:07:49 - Similar - Report/Block

I'm trying to wrap my head around using polymorphic associations to make file management less repetitive in a simple rails app. I'm using carrierwave to handle the file uploading. Here's what I have so far: app/uploaders/file_uploader.rb class FileUploader < CarrierWave::Uploader::Base def store_dir "uploads/#{model.class.to_s.underscor...

Do routing specs support redirect routes? [RSpec]

stackoverflow.com - 2012-06-01 01:07:20 - Similar - Report/Block

After digging fairly deeply on this issue, I've come to an empasse between my understanding of the documentation and my results. According to https://www.relishapp.com/rspec/rspec-ra ils/v/2-8/docs/routing-specs/route-to-ma tcher , we should be able to write the following: #rspec-rails (2.8.1) #rspec (>= 1.3.1) #rspec-core (~> 2.8.0)...

Examples and advices on combining a Polymorphic Association and a Single Table Inheritance

stackoverflow.com - 2011-05-05 09:56:57 - Similar - Report/Block

I am using Ruby on Rails 3 and I would like to know a real world example (or more) and some advice on when I should\can\must use the combination of a Polymorphic Association and a Single Table Inheritance as implemented here at the Polymorphic Association paragraph...

RSpec: What is the difference between a feature and a request spec?

stackoverflow.com - 2013-03-02 11:29:08 - Similar - Report/Block

What is the conceptual difference between Rspec's feature and request specs? From the feature spec docs: Feature specs are high-level tests meant to exercise slices of functionality through an application. They should drive the application only via its external interface, usually web pages. And for request specs: Request specs provide...

Model an undirected graph in Rails?

stackoverflow.com - 2011-11-02 05:45:45 - Similar - Report/Block

Importing the language of graph databases , understand nodes represented by circles edges represented by arrows ), and properties metadata of nodes / edges The graphic (courtesy of wikipedia) describes a directed graph What's the best way to model an undirected graph in Rails? That is to say, a graph where all edges are reciprocal ( as i...

Extending parent routing when extending bundles

stackoverflow.com - 2011-09-29 15:06:40 - Similar - Report/Block

In Symfony2 (2.0.3) I have a BetaBundle that is set as the parent of a AlphaBundle. Is it possible to override some routes while still keeping the parent originals routing definition ? I have tried importing the parent routing.yml inside the child routing.yml file but it naturally result in a circular reference exception. Is there any st...

Rails 3: Devise user with Polymorphic association for different user profiles

stackoverflow.com - 2013-03-01 19:52:36 - Similar - Report/Block

I have a Rails app. I installed Devise. I want to have a polymorphic association between the User model and the different profiles, for example: Student and Mentor. This is what I'm trying to do: have a student registration page with the regular devise fields such as: email password password_confirmation . But I also want to have fields s...

Backbone.js and Rails routing

stackoverflow.com - 2012-04-03 02:06:14 - Similar - Report/Block

I'm trying to learn how to integrate Backbone.js with Ruby on Rails. I'm using the rails-backbone gem and have followed the example given at the bottom of the readme to scaffold a simple application so I can study the code. When I run the server, my index page shows up with a list of objects from my database (I created a few test objects...

Polymorphic has_many: through in rails

stackoverflow.com - 2012-03-27 19:37:42 - Similar - Report/Block

I have a tags model that I'd like to be polymorphic, but I don't want five records for a tag of "video" for example, I want to create the tag once and be able to use it on a variety of models. I've ready some of the questions here about doing that, but I'm not quite getting how to make it work. So I've got: class Tag < ActiveRecord::Ba...

evolveStar Join

One-click installers: Ruby

webfaction.com - 2013-05-30 17:31:47 - Similar - Report/Block

For our second post taking a closer look at the one-click installers available with the WebFaction control panel, it’s time to look at running Ruby applications. For Ruby developers, we have two key installers: Ruby on Rails and Passenger. Ruby on Rails Ruby on Rails , commonly known as just Rails, is the dominant web application framewor...

What's the best way to determine whether a polymorphic join table is appropriate

stackoverflow.com - 2012-02-25 11:21:11 - Similar - Report/Block

I'm trying to figure out whether I should make a polymorphic join table for a many to many relationship or whether I should make multiple join tables. For things like comments, I always use a polymorphic join table. For relationships between users, like following on Twitter, I don't use polymorphic join tables. This is just out of habit.

Is it possible to place Rails controller files in app/controllers sub directories?

stackoverflow.com - 2012-02-24 18:24:15 - Similar - Report/Block

I'm using Rails 3 and I'd like to move some controller files from app/controllers app/controllers/a-subdirectory . I don't want to namespace those controllers and they don't correspond to nested resources. It is only to have a more organized file structure. When I try to articles_controller app/controllers/a-subdirectory and call a relat...

polymorphic relationships and interfaces/abstract classes/protocols

stackoverflow.com - 2012-02-25 04:01:19 - Similar - Report/Block

I have a polymorphic model Comments that I associate with almost every other model. I have comments index page where I use the title of the model, which I call commentable What is the best way to ensure that the commentable model has a method or attribute called :title In Objective-C I would define a protocol and in other languages I wo...

Rails Routing Issue - Uninitialized Constant Games

stackoverflow.com - 2012-03-25 04:39:41 - Similar - Report/Block

I am having a problem with my rails routes file. I have the following match in my routes file: match '/games/:game_id/increment_cool' => 'games/:game_id#increment_cool', :as => 'games_incrementcool' I then try to use this route from my games view like so: <%= link_to 'Cool!', games_incrementcool_path(@game) %> but I am recei...

Devise user with Polymorphic association for different user profiles

stackoverflow.com - 2013-03-01 19:52:36 - Similar - Report/Block

I have a Rails app. I installed Devise. I want to have a polymorphic association between the User model and the different profiles, for example: Student and Mentor. This is what I'm trying to do: have a student registration page with the regular devise fields such as: email password password_confirmation . But I also want to have fields s...

Need help to understand :source_type option of has_one/has_many through of Rails

stackoverflow.com - 2012-02-29 15:30:21 - Similar - Report/Block

In Rails 3.1, the documentation says "4.2.2.13 :source_type The :source_type option specifies the source association type for a has_one :through association that proceeds through a polymorphic association. I just read :source explanation but still dont get what source_type is used for?...

Is there a Rails function or a gem to display all the controllers and actions a user went through before displaying the result page?

stackoverflow.com - 2012-03-25 18:28:59 - Similar - Report/Block

It is for educational purpose. At the moment I am using %= debug(params) if Rails.env.development? %> to display very basic information like the action, the controller, the id, etc. that were called after I clicked on a link. I'd like to know if it's possible to have the same kind of debug information, but to display the succession of...

.NET Routing Actual URL

stackoverflow.com - 2012-05-07 21:10:40 - Similar - Report/Block

I'm using Routing with .NET web forms. (.NET 4.0) How can the page find out what the actual URL is? For example, at the following URL: /routing/friendly-url/ I want the page to print out: /folder/mypage.aspx...

Rails fails to install

stackoverflow.com - 2012-04-29 23:28:44 - Similar - Report/Block

I'm trying to install rails on a Mac but am getting some strange errors: sudo gem install rails Successfully installed rails-3.2.3 1 gem installed Installing ri documentation for rails-3.2.3... file 'lib' not found Installing RDoc documentation for rails-3.2.3... file 'lib' not found rails --version Rails is not currently installed...

Lion Server, Profilemanager, RVM and Rails not work together

stackoverflow.com - 2012-04-14 16:26:07 - Similar - Report/Block

Lion Server is absurd. On a Mac, I ran the installation and setup of Lion Server 10.7.3 then I installed rvm, Ruby 1.9.3 and Rails 3.2.3. On a Mac it worked perfectly while in the second Mac is not working and I get in the log devicemgr: <Info>: default_profile_created_at_least_once was already true Apr 10 20:23:26 <Name of Serve...

Should we remove facebook app-generated requests?

stackoverflow.com - 2012-05-05 20:45:47 - Similar - Report/Block

I am using facebook app-generated requests for sending notifications to users. I noticed that the notification is going away once the user logs in into the application. Does the requests get deleted automatically? I mean, without performing any action on the request ids. We used to delete those requests in the case of user-generated reque...

Mac OSx Lion - Cannot get RoR installed

stackoverflow.com - 2012-06-16 06:19:19 - Similar - Report/Block

I recently upgraded to Lion and I am trying to install Rails. I used RubyGems to install rails and each time I tried to start a new rails project I would get an error saying, "Method 'list ' was not found". So I unistalled Rails using RubyGems. I noticed I had two versions installed. I uninstalled both. I then ran 'gem clean'. Once again...

Using a subdomain to access a Rails3 app from VirtualBox

stackoverflow.com - 2012-04-10 20:35:49 - Similar - Report/Block

I have a rails app that is set up to use subdomains. When accessing the app via the URL "on.lvh.me", I can prepend with a subdomain, and get routed to the desired page. woot! Now doing cross browser testing via Virtualbox, I'd like to access the same (subdomain) page. After adding a few host entries to hosts on the windows side, I hit the...

Ruby / Rails working with Delphi back end

stackoverflow.com - 2013-03-18 18:15:14 - Similar - Report/Block

Can anyone point me to some sources or tutorials that would help me wrap my head around using Rails to connect/inquire with a Delphi backend (using a Firebird database). Also, a few questions regarding this setup. Is a Delphi back-end faster than a rails back end? Delphi seems to have far better support for connecting to firebird than the...

Ruby on Rails Localhost routing issue

stackoverflow.com - 2009-09-24 02:26:02 - Similar - Report/Block

Quick question which I hope is easily answered.. I am following this tutorial: http://oreilly.com/pub/a/ruby/archive/ra ils.html?page=2 and all is going well until I try create a controller and view it in my browser. The server is running and it shows the default page okay ( http://127.0.0.1:3000 I ran ruby script\generate controller MyTe...

TP Link Router Help

techguy.org - 2013-06-11 12:37:27 - Similar - Report/Block

Hi, I need to be able to communicate from my PC on the LAN (10.16.xx.xx) to a PLC / HMI is a furnace which have a 192.168.xx.xx type address and communicate with each other via a switch. I was hoping to use static routing on a router (TP Link TL-R402M) to allow me to connect with the PLC. I have tried a few options but I am unable to ping...

Does the compiler optimize non-polymorphic calls to virtual methods?

stackoverflow.com - 2013-06-09 14:35:12 - Similar - Report/Block

Does the compiler optimize/inline non-polymorphic calls to virtual methods? I mean when the call is in a non-polymorphic context so everything is known at compile time?...

Ruby Science: Inheritance, Composition, STI, and Polymorphic Associations

thoughtbot.com - 2013-02-08 22:11:27 - Similar - Report/Block

Todays’ release of Ruby Science includes two new chapters. If you’re already reading Ruby Science, make sure to log into GitHub and download the latest version. In this week’s updates, we cover composition and inheritance. You’ll learn about the uses and drawbacks of Single Table Inheritance (STI), as well as how to convert an STI hierar...

Rails server hangs when started with foreman

stackoverflow.com - 2012-08-08 02:50:46 - Similar - Report/Block

Here's what my Procfile looks like: web: bundle exec rails server thin -p $PORT -e $RACK_ENV worker: bundle exec rake jobs:work I intend to add a worker process because I wish to run some background jobs. I'm following these instructions This is what I noticed: - No problems encountered with only web process running, i.e., if I delete th...

Resque worker logging slows down Rails responsiveness

stackoverflow.com - 2012-05-24 15:52:04 - Similar - Report/Block

I have a Resque job which pulls a csv list of data off of a remote server and then runs through the +40k entries to add any new items to an existing database table. The job is running fine however it severely slows down the response time of any subsequent requests to the server. In the console which I've launched 'bundle exec rails server...

`rails c` or `rake` bloat memory

stackoverflow.com - 2012-05-25 14:24:29 - Similar - Report/Block

when I try to start ENV_RAILS=production rails c (or a task) some process killer on the server kills the process after a few seconds because it uses more than 400mb of physical memory. Now I need to find out where that bloat comes frome. The server I know about newrelic and oink - but they seem only to work for server requests - not con...

Ruby coder Pro needed. by bradleysnider

freelancer.co.uk - 2012-09-11 08:43:41 - Similar - Report/Block

Need help on scraping data into ruby on rails. Need to design existing PSD into Rails by real rails coder. Please if you do not work on rails dont pretend to. I need someone that is as good as me not someone... (Budget: $250-$750 USD, Jobs: AJAX, HTML, PHP, Ruby & Ruby on Rails)...

Trying to get selenium working in rails 3 - "WebMock::NetConnectNotAllowedError"

stackoverflow.com - 2011-05-12 17:56:48 - Similar - Report/Block

I'm trying to use selenium for the first time in a rails 3 app. (I've used it before with rails 2). I'm in an rvm which of course has its own gemset. I first ran a task with capybara, without selenium: #./spec/requests/homepage_spec.rb require 'spec_helper' describe 'home page', :type => :request do it 'should welcome the user' do...

How to get at runtime the route name in Symfony2 when using the yaml routes description?

stackoverflow.com - 2012-04-27 12:43:27 - Similar - Report/Block

Here you can find my -th question on Symfony2. I'm working with a pagination bundle that uses the route name provided in the routing.yml file. From my perspective, this approach is not flexible and lead to a dirty code, since if I change the name of the route, then I have to look at all the Twig templates or PHP files to update the rout...

ASP.NET MVC + WebForms - route conflict

stackoverflow.com - 2012-03-01 10:37:01 - Similar - Report/Block

I'm building a simple report Web app for rendering reports using ASP.NET MVC3 + WebForms. The reports themselves are rendered by the ReportViewer ASP.NET WebForms control, but I'd like use ASP.NET MVC to create the parameter entry. I'd like to have that all requests follow the default routing scheme of '~/{controller}/{action}/{parameters...

How to assign a Unique Level Assessment on Has-Many Relation, Rails

stackoverflow.com - 2012-09-10 21:08:09 - Similar - Report/Block

So I'm trying to come up with a smart/the best rails way to do this, and would appreciate discussing with SO users the best method. Essentially I have two models, let's call the first a Photo and the second an Attribute. A photo has_many attributes (as examples, let's give saturation, color, warmth etc..). The Attribute model carries and...

Проблемы с установкой Rails - Ruby on Rails

cyberforum.ru - 2013-02-26 21:58:51 - Similar - Report/Block

Ubuntu 12.10 Код: $ ruby -v ruby 1.9.3p194 (2012-04-20 revision 35410) [i686-linux] $ gem install rails ERROR: Could not find a valid gem 'rails' (>= 0) in any repository ERROR: Possible alternatives: rails Что делать?...




dialogShowMessage!

Fill out the form you see below. Registration is free, fast and simple.
If you are already registered, sign in page login.


Web Site :
Required Field
First Name :
Required Field
Last Name :
Required Field
Email :
Required Field
Sex :
Required Field

evolveStar.com is free for ever !


evolveStar.com provides a search engine that allows you to gather information to write their own blog.


evolveStar.com enhances the sources displaying the logo of the site.


If you want to remove your site or you believe a site listed infringes copyright, please report it to: info@evolvestar.com


Specifies the subject copyright violation and the url of the page


evolveStar.com respecting the law DMCA (Digital Millennium Copyright Act) will immediately remove whatever its merits.


Next will be effectual and relevant checks.







Who We Are Partner Advertising Contacts Privacy terms Help & FAQ

© Copyright 2010-2017 Fabrizio Fichera. All rights reserved.