I've been checking my production.log today and there's a number of requests hitting my site that appear to be malicious, but I'm confused as to how they're even getting to us.
For example:
Processing PublicController#unknown_request (for 217.23.4.13 at 2009-11-09 09:15:52) [GET]
Parameters: {"anything"=>["results.aspx"], "action"=>"u...
I am looking for a Ruby script that takes a piece of text, and makes any links click-able that show up in it... Does anyone have something like this? For example, if I wrote a comment and said "Come check out my site at http://www.example.com", then the link would be click-able like an html tag.
Thanks,
Josh
...
Hi there,
I began reading the book "Code Complete" 2nd edition, but stopped reading when I noticed most of the solutions were easily solvable in Ruby with Ruby idioms. Is there a similar book for Ruby?
Here's the version that I started reading:
http://www.amazon.com/Code-Complete-Practical-Handbook-Construction/dp/0735619670
...
If my models look like this:
(app/models/letter.rb)
class Letter < ActiveRecord::Base
def cyrilic_equivilent
# return somethign similar
end
end
class A < Letter
end
class B < Letter
end
Can my migrations also follow this pattern:
class CreateLetter < ActiveRecord::Migration
def self.up
create_table :letters do |t|
...
Is there a easy-used two-way encryption method for string in ruby?
...
I have a simple point of sale application written in ruby and rails, and hobo.
Originally intended to be for only one product at the time, now the client wants to add multiple products into the sale model
Besides that i am using brands for categorizing products and in my new sale form i use ajax in order to populate a select product me...
i have a codes model and i a basically have a form wich should authenticate simply to every code recorded so my controller is:
def cancel_sale
@codes = Code.find(:all)
@codes.each do |c|
@code = c.name
end
if params[:auth] && params[:auth] == @code
something
else
@mensaje_de_salida = "wrong auth code"
en...
Hello everybody!
At the moment I am building my new Website.
On my Website, users are allowed to post some code (Java, Rails, Ruby, HTML, CSS,...).
Now I want to format that code in frontend like on Stackoverflow.
Is there a plugin I can use in Rails?
I had a look on some rich text editors, but most of them did not do what I wanted them ...
I have the following entry in my database:
t.time :my_time_stamp
In my controller I update it like this:
model.update_attributes(:my_time_stamp => Time.now.utc)
I can see that I'm writing:
Mon 9 November, 8:54.54 UTC 2009
However, when I later read this value I get:
Sat Jan 01 08:54:54 UTC 2000
It seems that the time part has...
Hi,
I am sending an email from a rails app with HTML format.
It's utf8 format and I write Korean.
Some characters are broken when I get it with gmail or yahoo mail.
I checked the log and it sent ok.
But when I checked original text from gmail, a long line was forced to break line.
Correct text:
연합회 홈페이지는
Broken text:
...연합회 �
�페이지...
Hi,
we have a mixed development environment using ASP.NET MVC and Ruby on Rails. We have come from a purely C# / ASP.NET background, but now have some rails experience and we love both. Problem is deciding at the beginning of a project which one to use can sometimes be tricky.
Any tips for how to explain to the non technical members of...
Hi.
I have a standard active record model with an attributes that is required:
class Sample < ActiveRecord::Base
has_many :colors
before_validation :grab_colors
validates_presence_of :size
validate :number_of_colors
private
def grab_colors
# grab x number of colors | x = size
end
def number_of_colors
self...
Apologies if this is a slightly noob question, but looking to clarify my thoughts on this. I have a model that can EITHER belong to one model, or another. For example:
Let's say I have a Team model and I have a Member model, and both of those models can have one BankAccount.
class Team
has_many :members
has_one :bank_account
end
c...
For better frontend performance, it's best practice to put your scripts at the very end of your HTML code.
I did that for a pretty big and complex page I'm working on right now and the problem I run into are many inline scripts in the views, mostly generated by Rails' built-in JavaScript helpers. These scripts depend on the libraries th...
Can someone please clarify using a SIMPLE user story the full slice of what Cucumber would be used for and what RSpec would be used for? I purchased the RSpec book the other day and have been going through it. The author seems to be quite vague at times.
What I'm thinking of if the user story is something like (please excuse the synta...
Dear all,
I’m developing an application dedicated to generate statistical reports, I would like that user after saving their stat report they save sql queries too. To do that I wrote the following module:
module SqlHunter
class ActiveRecord::ConnectionAdapters::AbstractAdapter
@@queries = []
cattr_accessor :queri...
guys which text editor is good for Rubyonrails?
i m using Windows and i was using E-Texteditor but its not free n its expired now can anyone plese tell me any free texteditor?
n which one is best an light among netbeans and aptana?
...
I'm building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished?
hash.to_xml
...
I have a these 3 models:
class User < ActiveRecord::Base
has_many :permissions, :dependent => :destroy
has_many :roles, :through => :permissions
end
class Permission < ActiveRecord::Base
belongs_to :role
belongs_to :user
end
class Role < ActiveRecord::Base
has_many :permissions, :dependent => :destroy
has_many :users, :thro...
Kind of hard to explain but I'm going to try: I have a model called Message, which represents a request for an email to be sent out, a model called Segment which is pulled from a third-party application using a MySQL view (and is read-only), and finally a User model. Segment and message both belong to a user.
The problem is that I nee...