I need to connect to a legacy SQL Server 2000 database using their own conventions and specially CamelCase columns and Tables. For tables it seems fine, Rails is asking it with lowercase and the database find it nicely. The issue is with the columns because Rails fetch their name with...
I have started coding during my free time for over a year now. I had a social community idea which will be location based which basically deals with locations and nearby trending places. I did some 10 minute video about scaffolding and have been totally smitten by Ruby on Rails. I rea...
Is it possible for a web application developed using ruby on rails framework to intercept all calls to it with a third party security tool. Any call to this web application goes to security tool instead of web application itself and then security tool can redirect it to web applicatio...
I have Devise gem for user authentication. Basically, I want to override registrations_controller.rb in Devise gem locally. The code in gem: class Devise::RegistrationsController < DeviseController ... def update ...(need to override) end end I want to redirect user to other page if p...
I am creating an open source workflow that will tie an OS X application Devonthink to Zotero in the following manner: An AppleScript called inside the OS X app devonthink will run a Ruby script via the shell This Ruby script (which I find much faster, better for these sorts of things ...
Migrating from MetaWhere to Squeel and away from using symbols Squeel to execute outer join on Rails 'on' option to joins in squeel Using NOW() in a select with Squeel Squeel query comparing 2 variables Rails ActiveRecord::StatementInvalid: PG::Error: ERROR: missing FROM-clause entry ...
I am using simple_form in rails to create certain events. To create a new event, you are required to login as a user. The form will ask the user to enter the event name, start date, and end date. When the user clicks the submit button, I want the form to automatically update the attri...
I have an ActiveRecord model that has two columns I want to group and sum by (both are integers). The issue I can't seem to solve is how to sum the first column as a group of the second column, with the second column being grouped by a range. I know that I can do Model.sum(:first_colu...
The word "deployment" can have two meanings depending on the context. You are also confusing the roles of Apache/Nginx with the roles of other components. Apache vs Nginx They're both web servers. They can serve static files but - with the right modules - can also serve dynamic web ap...
> bundle Updating git://github.com/rails/rails.git Unfortunately, a fatal error has occurred. Please see the Bundler troubleshooting documentation at http://bit.ly/bundler-issues. Thanks! .rvm/rubies/ruby-2.0.0-preview1/lib/ruby/2.0.0/psych.rb:205:in `parse': (<unknown>): mapping valu...
I have a table rb wich has many interfaces , then each interface has many interface_graph_data . Now my rb interface has_many relation seems to work fine, my only problem is the interface interface_graph_data relation. Here are my models. class Rb < ActiveRecord::Base validates_presen...
I am reading a book for "Ruby on Rails". In the "application.js", we are including other JavaScript libraries in the following way and more specific - jQuery UI: //= require jquery //= require jquery_ujs //= require jquery-ui As this is ordinary JavaScript file (not ruby extensions he...
I tried testing routes and just copied the example from the rspec-rails documentation. describe "routing to profiles" do it "routes /profile/:username to profile#show for username" do expect(:get => "/profiles/jsmith").to route_to( :controller => "profiles", :action => "show", :userna...
I used a migration in ruby to create these tables together with a model. I have a Table Information and a Table Detail, each entry in the information table can have one association in the detail table. So i created them with: create_table :details do |t| t.integer :id t.string :Bezeic...
I was trying to integrate pusher to my ruby on rails application. However I'm not able to send messages using the steps provided in the tutorial. Here is what I have accomplished so far: 1. Followed the steps in the tutorial 2. Got the Chat UI to appear for the URL I want to. 3. Got t...
I read Growing Object-Oriented Software, Guided by Tests by Steve Freeman and Nat Pryce and was impressed very much. I want to adopt the ideas of this book in my Rails projects using RSpec, though its examples are written in Java. A basic precept of this book is that we should mock in...
Okay, I've decided to use the twitter gem. The problem is I havent a clue how to go about using it because im new to ruby/rails. All I require is to display a list of the last 5 tweets from my own twitter account, with the times they were posted. I honestly do not know where to begin.
I am porting a 2.x rails app to rails3; we'll call it foo-app. Foo-app is one section of a larger rails app and lives at main_rails_app.com/foo-app. Previously we just set up the following in our foo-app production config to ensure that our foo-app routes worked properly: ActionContro...
As of yesterday, I'm unable to update my bundle. It gets stuck at "Fetching source index for http://rubygems.org/ ". I know this usually takes a while , but I've waited for hours and tried several times over the last day. I have a 20 Mbit internet connection. I'm using gem 1.8.5, Bund...
I am trying to make an Generalization of some classes on my application. I have an "Employee" class that has "number", "name" and "salary" as attributes. I have the "Worker" class and the "Salesman" class that are both Employees and, therefore have all the "Employee" attributes. For e...
I have a Ruby on Rails web application, and I'm currently working on an Android application. I would like for the android application to make calls to the Rails application and make local objects from the results. For iOS, there is a framework called RestKit that does a great job mapp...
I am calling a dialog pop up box by the link_to method in ruby on rails. <%= link_to pro_generic_lookup_data_path("Enr::Rds::Question2009", format: :js), data: {remote: true} %> In the html its like exactly <a href="/pro/lookup_data/Enr::Rds::Question2009.js" data-remote="true"> Now, ...
AssociationTypeMismatch Error on Ruby on Rails app ruby on rails nil.to_sym error How are the error messages displayed in ruby on rails? How to display descriptive error message in ruby on rails Custom dynamic error pages in Ruby on Rails not working How should I deal with estimated d...
Controller logic for referenced_in and references_many in mongoid Modeling many-to-many :through with Mongoid/MongoDB Ruby on rails polymorphic model: dynamic fields Rails 3: how to use active record and mongoid at the same time Rails - Mongoid : newly added fields in model giving nil...
Sorry for the basic, basic question but I'm having some trouble understanding the RoR doc. say I have 3 models--Students, Classes, and Enrolled_in. If it isn't clear, students will enroll in classes, so Enrolled_in should have Students and Classes as foreign keys. I generated the mode...
I am using Single Table Inheritance and have comments on all the subclasses. I am only using 1 controller for all the different STI types. When the form_for helper generates a URL for a subtype it tries to use a helper for the subtype, but I want it to use the helper for the parent. T...
I am trying to use the devise gem for my rails 3.2 project but when i am trying to check for the sign_in page i am getting the following error: wrong number of arguments (3 for 2) Extracted source (around line #3): 1: <h2>Sign in</h2> 2: 3: <%= form_for(resource_name, resource, :url =...
So I need to create a web app for managing network security data. Right now the requirements are very poorly defined, so I need to choose a framework that is flexible and allows us to add new features with relative ease as requirements become clearer. I know this is a poor why to run ...
So i have a page with a like button under my comments and am trying to work out how to do this without refreshing the whole page currently the code looks like this: - if can? :like, comment = " · " - if likes.find_by_user_id(current_user.id).nil? = link_to "Like", like_comment_path(co...
I have a table storing some sound bites. I tried to create a loop which would read the table and then reread the table and delete and records which are close to being duplicates. My code is something like this: Numbersound.where{id != nil}.order(:id).each do |sound| Numbersound.where{...