How to Debug Internal working of Rails ?
Hi , I would like to know is there any way I could debug and understand the Internal working of Rails ActiveRecord , ActiveController , Request and Response working , dispatching etc. ...
Hi , I would like to know is there any way I could debug and understand the Internal working of Rails ActiveRecord , ActiveController , Request and Response working , dispatching etc. ...
How do I wrap a link around view code? I can't figure out how to pass multiple lines with ruby code to a single link_to method. The result I am looking for is that you click the column and get the show page: <div class="subcolumns"> <div class="c25l"> <div class="subcl"> <%= image_tag album.photo.media.url(:thumb), :class...
Does anyone have clear instruction for setting up jRuby to work with IIS. Edit: What I'm looking for is step by step instructions for getting a Ruby on Rails application working on Windows using IIS and jRuby. The reason being is because I can't find anything other then "use Linux" when asking the question out in the wild. For most peo...
What editor can you suggest to integrate with the backend of the web app I'm currently developing? I want to allow my trusted users to add articles that would be visible on the frontend. It should have some kind of markup language (to make basic customisation - lists, bold...) and if possible also the option to upload images. ...
Hi all, I am trying to achieve what I think will be a fairly complex query using the magic of Rails without having lots of ugly looking SQL in the code. Since my database is dealing with rather specialised biomedical models I'll translate the following to a more real world scenario. I have a model Book that has_many :chapters and C...
Hi there, I was told that for some reason, you can't update a database schema when using rails. You can drop a table and then recreate a table with an updated schema, but this won't work if you already have content stored in the table that you want to update. What do you recommend? Thanks! ...
I have my code working so that I have a table of businesses. There's a pencil icon you can click on the edit the business information. The edit information comes up in a partial inside of a modal pop up box. The only problem is that once they make the changes they want and click update, it sends them to the 'show' page for that busine...
I have two scaffold-generated Models, student and class. They have a many-to-many relationship implemented with has_and_belongs_to_many. I'd like to be able to change which classes a student is in as well as which students are taking each class. That is, I want to modify a student's classes variable (adding and removing items from it) ...
Hi everyone, I am trying to deploy a RoR app that does some asynchronous task. I use workling for that and the message queue is RabbitMQ. This combination worked flawlessly with Starling but we decided to change the MQ for Rabbit. I read somewhere that I should include the following code in my environment.rb require 'mq' if defined?(P...
I've this config in my apache2.conf <IfModule mpm_prefork_module> StartServers 5 MinSpareServers 5 MaxSpareServers 10 MaxClients 150 MaxRequestsPerChild 0 </IfModule> # worker MPM # StartServers: initial number of server processes to start # MaxClients: maximum number of simultaneous client connections #...
Ok, stupid question. How do you remove a HABTM associated item without deleting the item itself? For instance, say I have 3 STUDENTS that are in SCIENCE class together. How do I remove the SCIENCE object from the STUDENTS_CLASSES table without deleting the actual SCIENCE reference? I'm guessing that Student.Classes.first.delete is...
Hi All, Is there any way to use ActiveRecord calculations while also acquiring relevant field names? For example, I'd like to find the average age of all people with the various last names. Basically I'd like to use: Person.average(:age, :group_by => "last_name") ... as a substitute for "Select last_name, AVG(age) FROM Peopl...
I have this little rake task: namespace :db do namespace :test do task :reset do ENV['RAILS_ENV'] = "test" Rake::Task['db:drop'].invoke Rake::Task['db:create'].invoke Rake::Task['db:migrate'].invoke end end end Now, when I execute, it will ignore the RAILS_ENV I tried to hard-code. How do I mak...
Okay so from what I've read on other websites and on stack overflow, Rails throws this Authentication token error because my form doesn't pass the token -- and it's a security feature. This I understand. However I don't really have a form. I have ajax here -- my javascript posts the id'ed information into a processing function. So my q...
Is there any way to include php file using require and calling a php method in rails application ? I dont want to use phusion passenger as my server . ...
I've got rails_authorization_plugin up and running with models. What's the best way to implement permission checks on my site? I have complicated conditions for when an instance of an object should be visible, is there an efficient way to chain them together so I'm not fetching multiple sets of data and grinding my DB as a result of lo...
Hi All, I have a section of code in a controller that replaces existing HTML with an IMG tag. The code is as follows: render :update do |page| page.replace_html "chart-div", "<img src=\"#{chart.chart_file}\"/>" #chart.chart_file is a path end For whatever reason, I keep receiving the following error: ActionController::Routi...
I'm looking for something like CodeIgniter's: $this->db->last_query(); (http://codeigniter.com/user_guide/database/helpers.html) ...
I have requirement to write help(for example show description of what some button does) for my web app. Are there any good examples for doing this? ...
I have a process which iterates through a bunch of ActiveRecord models, does some processing, and saves the models again. Often though, the processing doesn't result in an changes to the attributes and so the updated_at column never changes (even though save is called). I'd prefer not to disable partial updates (in general, they're usef...