Hi,
I want to use rails page caching to speed up a application which encounters heavy load. But I also need to count the hits/views on the objects presented. So I have the model "Article" with a unique hit counter method (by IP) which is called every time the user hits the show action. That doesn't work with caching, so I'm wondering ab...
I want to validate login name with special characters !@#S%^*()+_-?/<>:"';. space using regular expression in ruby on rails. These special characters should not be acceptable. What is the code for that?
Thanks,
Pallavi
...
Hello, i have some issue with database.
Okay, i have two models -> Page and Item.
Page for displaying some content.
Item -> this is item discription.
So, i work on small ecommerce shop.
Okay, all of this models can have some comments.
So, this is my Comments model at this moment:
Comments ->
string : id
text : body
integer : page_i...
Is there a way to authenticate a user to LDAP with email (mail) and not cn or DN? We are using ruby ldap, and possibly active-ldap (we have been having problem with it, though). All we need to do is authenticate a user and then create a membership in our system based on the authentication success.
...
Dear experts,
is there any existing rails helper to create a valid URL?
Specifically, I am generating a Web URL with some parameters that having special character (for e.g space i need to convert into + , and many others special characters).
http://domain.name?param1=ABC+DEF&param2=GHI
Thanks.
...
Hello, I hope all is well. I am hoping someone can help me with a problem that I am certain is user error?
The configuration details below work in all my other environments including integration, development and qa. However, the production servers give the following error:
unable to find server during initialization.
When I telnet to...
I like to determine if a visitor has already submitted a form.
I was thinking of doing a couple of things:
cookie
ipaddress
requiring login (much less desirable since the signup barrier might dissuade visitors)
Is there a ROR gem for this? If so please post a link.
Thanks
...
Guys,
I'm trying to understand the new arel engine in Rails 3 and I've got a question.
I've got two models, User and Task
class User < ActiveRecord::Base
has_many :tasks
end
class Task < ActiveRecord::Base
belongs_to :user
end
here is my routes to imply the relation:
resources :users do
resources :tasks
end
and here is my ...
Hello,
I am getting an error while trying to upload images on an Ubuntu machine that's running Rails 2.3.4, Ruby 1.8.6 using attachment_fu with image science.
FreeImage exception for type ???: IPTC: Invalid key 'Tag 0x025C'
The error seems to point to this line in the image_science_processor in the attachment_fu plugin:
def with_imag...
Hello,
I am having an issue trying to save into an intermediate table. I am new on Rails and I have spent a couple of hours on this but can't make it work, maybe I am doing wrong the whole thing. Any help will be appreciated. =)
The app is a simple book store, where a logged-in user picks books and then create an order.
This error is ...
I've been looking around for a while now and the best guide I've seen so far is Dr Nic's DIY widgets how to (here).
I haven't been able to make something like this work:
Assuming this is my widget code:
<script src="http://mysite/nomnoms.js"> </script>
And my nomnoms controller looks like (assume that the list partial exists and...
If you use haml as rails view template, you can write portion of your page using markdown by using the ":markdown" filter.
Is is possible to do the same using erb?
...
My problem is is that paperclip saves the attachments appropriately, and I assume imagemagick is doing something right. With no errors returning, the images never finish processing.
Does anyone know a way to see what's backgrounding?
Or specifically a way to review imagemagick's processes?
...
I want to create several link_to_remote links that are campaign names:
<% @campaigns.each do |campaign| %>
<!--link_to_remote(name, options = {}, html_options = nil)-->
<%= link_to_remote(campaign, :update => "campaign_todo",
:url => %>
<% end %>
I want the output to update on the page to render ...
I'm not quite sure how to go about diagnosing this issue, after switching my app to Ruby 1.9.1 I'm getting this error:
TypeError
wrong argument type Mysql (expected Struct)
And it seems the app fails to boot, so I'm not really sure of how to even begin solving this issue. I've made sure all my gems are up to date and they are.
I'm us...
I am new to the language and I need to know what are the top things that are absolutely necessary to know in order to make a fully functional website or web app using the Ruby programming language?
Mainly Ruby on Rails with Rake and other tools that mainly use Rake.
Update: I know many other languages like C++, Java, PHP, Perl, etc, et...
In our Intranet environment we have a decree that common assets (stylesheets, images, etc) should be fed from Apache root while Rails apps runs from from a "sub directory" (a proxy to a Mongrel cluster). In other words:
<%= stylesheet_tag '/common' %>
# <link href="http://1.1.1.1/stylesheets/common.css" />
<%= link_to 'Home', :contro...
I have a bunch of forms listed in Rails like such
<% parent.children.some_named_scope.each do |child| %>
<% form_for :parent, parent do |f| %>
<% child.possible_values_for_column_to_set.each do |value| %>
<% f.fields_for :children, child, :child_index => child.id.to_s do |child_form| %>
<%= child_form.label :co...
I want to be able to display an HTTP 500 error with an XML builder template if the request Accept type is asking for XML. By default it displays 500.html, even if the request type is not asking for an HTML response.
...
I have a Book model, which has_many Chapters (which belong_to a Book).
I want to ensure uniqueness of Chapter titles, but only within the scope of a single book. The catch is that the form for creating chapters is embedded in the Book model's form (The Book model accepts_nested_attributes_for :chapters).
Within the Chapter model:
va...