I have installed XAAMP on my win7 machine and I have the apache server/mysql running on there. I set up rails to work with XAmpp as described here: XAMPP and RAILS
This tutorial advises you to add this code to the XAMPP httpd.connf :
Listen 3000
LoadModule rewrite_module modules/mod_rewrite.so
#################################
# RUBY S...
Say I have a model called Book. I have a controller named books and related views for this model. Is it possible if I have another controller work with the model Book?
Thanks all. :)
...
vb6 application calls the comcalllable .net class library which requires the configuration file ,how can we porvide the config file?
...
Hi,
Is it possible to create user defined Rails environment.... By default support development,staging,production,test... Other than that is it possible for user defined environment.... If yes how? ... please suggest me on this ... thanks in advance...
...
Basically what's the difference between design pattern, module and some other terms we use.
...
Hello,
total ruby newbie, trying to setup a Rails/MongoDB application on Mac OS X Snow leopard.
Installed Ruby 1.9.1 and RubyGems 1.3.7, which ruby and which gem point to the same directory. I'm using the Snow Leopard built-in apache and Passenger 2.2.11. I'm using the rails template from the mongo-site which seems to work okay overall...
Model Item belongs_to User.
In my controller I have code like this:
@items = Item.find(:all)
I need to have a corresponding User models for each item in my View templates.
it works in controller(but not in View template):
@items.each { |item| item.user }
But manual looping just to build associations for View template kinda smells...
Finally found out how to achieve this!
Turned out it is as simple as enabling xsendfile and setting header parameter Accept-Range
Read my answer below
(by the way, in the block quote below I wrote a common pitfall newbies - like I did - made. We tend to think it should be manually programmed)
URL must be something like:
mysite.c...
I'm currently building an API. This API communicates with the client via status codes. I created several custom status codes (as per http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6) in order to inform the client on certain things. For example I introduced the 481 status code to signify a specific client error.
The Rails app ...
Hi guys,
I'm developing a JAX-RS application and it's working fine. Now, I want to develop a web service client application using Rails. And my question is which is the best way to parse a RESTful webservice's response in Rails?
...
I want to make a table within a form by making a new form_tag. The following code in ApplicationHelper fails:
module ApplicationHelper
class TabularFormBuilder < ActionView::Helpers::FormBuilder
# ... code to insert <tr> tags </tr>
end
def tabular_form_for(name, object = nil, options = nil, &proc)
concat("<table>", proc.bindi...
Hi all,
I'm working on a site that has quite a few pages that fall outside my limited understanding of RESTful design, which is essentially:
Create, Read, Update, Delete, Show, List
Here's the question: what is a good system for labeling actions/routes when a page doesn't neatly fall into CRUD/show/list? Some of my pages have info ab...
Good day! I am a newbie at Ruby on Rails, and part of my previous tasks was to make a dynamic form generator using nested models, as seen in Railscasts 196 and 197 ( http://railscasts.com/episodes/197-nested-model-form-part-2 ). I have successfully implemented it using so.
For my current task, however, I need to reproduce the same form m...
Hello,
Is it possible to move the (/tmp/stream*) tempfiles generated by paperclip to another location like /railsapp/public/tmp without changing tmpfiles for the whole app enviroment? I would like to show a preview of the uploaded file if valdation fails on the model.
Best regards.
Asbjørn Morell
...
Hi Everyone,
I have a date_select field in my rails application as follows:
<%= f.date_select :dateinstructed %>
I would like to re-order the drop down lists show they output as:
DD/MM/YYYY
According to what I have read you can use the :order option, but I am unsure how to actually use this option:
<%= f.date_select :dateinstruc...
I am checking for XSS vulnerabilities in a web application I am developing. This Rails app uses the h method to sanitize HTML it generates.
It does, however, make use of the jQueryUI autocomplete widget (new in latest release), where I don't have control over the generated HTML, and I see tags are not getting escaped there. The data f...
I have the following relation in my rails app:
genre
- has many - authors
authors - belong to genre and has many books
books - belongs to authors and belongs to users
(users can add books to the db)
in my controller I have:
@books=current_user.books(:include => [:author => :genre], :order => 'books.created_at DESC')---
--
In my...
I'm loading data from my database and I'm doing a sum calculation with a group by.
ElectricityReading.sum(:electricity_value, :group => "electricity_timestamp", :having => ["electricity_timestamp = '2010-02-14 23:30:00'"])
My data sets are extremely large, 100k upwards so I was wondering if its possible to use the find_each to batch ...
Does anyone know how to make rspec follow a redirect (in a controller spec)? (e.g test/unit has follow_redirect!)
I have tried "follow_redirect!" and "follow_redirect" but only get
undefined method `follow_redirect!' for #<Spec::Rails::Example::ControllerExampleGroup::Subclass_1:0xb6df5294>
For example:
When I create an account the p...
What exactly would be the best way to go about using a cron task to send daily e-mails of updates to all users on my network? The e-mail would be made up of different information from multiple models.
I want to do something like "1 new friend requests : name ..." from the request model and user model and "There are 3 upcoming events f...