But that made me question why I couldn't just put the "/" inside of
the bracket as well. Like why did that have to be escaped if the
period didn't. (I guess it's because in that syntax, the forward
slash has closure properties.)
Oh well it's working now, and I escaped the . as well (\.).
Thank yo
hello iam maryam ihave peroblem ishal go aftenon by
On Sat, Dec 19, 2009 at 11:21 AM, ralu wrote:
>
>
> On Dec 18, 11:01 pm, AlwaysCharging wrote:
> > In my app, I allow users to submit urls. They (of course) need the
> > ability to submit urls with a forward slash, "/", but whats the
> > regu
It actually depends on where the "." is in the Regexp. In your case it
is inside a Character Class "[]". So it is matching the "." character
explicitly. Since \w is shorthand for the [a-zA-Z] character class. It
is parsed as a character class instead of an escaped "w" character. So
you could actual
This is perfect! Thank you Emery.
I was thinking the same thing, but was trying before_save filters and
couldn't get it to work for the Update action.
Honestly, I didn't even know about the before_validation helper, guess
I got some more learnin' to do.
Thanks again.
And @Rick, thank you for the
On 19 Dec 2009, at 16:15, Jakub wrote:
> I am quite happy with TinyMCE and there is a Rails plugin that
> simplifies the usage. If you use ActiveScaffold, it has a bridge that
> you can use and have TinyMCE editing in practicly no time. The file
> upload is AFAIK supported by a plugin fork
>
> ht
Seems like the perfect place for a call back if you're doing this
without discriminating.
class Comment < ActiveRecord::Base
...
before_validation :trim_blog_comment
protected
def block_comment
self.blog_comment = blog_comment[0..140] if blog_comment.length >
140
end
end
Now it's
On Sat, Dec 19, 2009 at 3:20 PM, AlwaysCharging wrote:
> Currently I'm using .build in my Create action so that I have a little
> more control before it gets saved. For instance, I have:
> �...@comment = current_user.comments.build(params[:comment])
> �...@comment.blog_comment = @comment.bl
I have solved it finally.
After doing a
gem update --system
it works fine...
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send em
On Sat, Dec 19, 2009 at 1:12 PM, radu puspana wrote:
> thx a lot rick, for taking you time to answer to my problem
> yeah, it was a typo it was line_items, instead of list_items.
> but...still don'tget something, i'm a rails noob what would you
> expect :(
>
> what does rails exactly do when you w
Currently I'm using .build in my Create action so that I have a little
more control before it gets saved. For instance, I have:
@comment = current_user.comments.build(params[:comment])
@comment.blog_comment = @comment.blog_comment[0...140]
to chop the blog_comment off at 140 characters.
On Dec 17, 2:55 pm, Josh wrote:
> We recently upgraded from 2.0.old to 2.3.5.
>
> Now when we run migrations schema.rb is not getting automatically
> updated. (the migrations do work though)
>
> db:schema:dump seems correctly dump the schema and update schema.rb
>
> Any suggestions on where to s
Hi Doug,
On Sat, 2009-12-19 at 10:13 -0800, doug wrote:
> It appears that the question, "How do I create a slide show" has been
> asked many times in a variety of ways in this group. Reference has
> been made to the O'Reilly book, "Ajax on Rails". Maybe I need to read
> that. In any event, I d
Yes I am doing it from a "ruby console" from within instant rails.
Still not had any joy.
G.
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from thi
It appears that the question, "How do I create a slide show" has been
asked many times in a variety of ways in this group. Reference has
been made to the O'Reilly book, "Ajax on Rails". Maybe I need to read
that. In any event, I don't want to get into a long discussion of the
broad issues relati
Yes, that did it. Thank you.
No idea how I try everything and overlook the simplest solution, duh.
And, Thank you to everyone else that weighed in as well, definitely
some other options to look into.
Side note: Anybody know why the period doesn't have to be escaped?
Like just "." allows the dot
thx a lot rick, for taking you time to answer to my problem
yeah, it was a typo it was line_items, instead of list_items.
but...still don'tget something, i'm a rails noob what would you
expect :(
what does rails exactly do when you write li.product =
cart_item.product ???
and wouldn't it be more
You are running into this because of a bug/misfeature. See this
lighthouse ticket:
https://rails.lighthouseapp.com/projects/8994/tickets/2289-_methodput-ignored-for-xhr-and-xml-requests
Apparently you can set an HTTP_X_HTTP_METHOD_OVERRIDE header, but that
doesn't work for me either.
On Nov 28, 9
2009/12/19 giorgio :
> Hi
>
> I have just setup instant rails on a windows box.
>
> I have migrated an app from Linux and I need to install some
> additional gems and upgrade rails to be the same version as on the
> Linux environment.
>
> I am completely unable to install any gems.
>
> I get messag
On Sat, Dec 19, 2009 at 6:34 AM, radu puspana wrote:
> Hey guys,
>
> i ran in some trouble while making an important app for school, and
> the deadline is so soon, that i took a desperate decision, bother
> you..
> I will put up the code here, and if anyone has a solution, it would
> mean the worl
Rick,
You hit the nail right on the head! In my controller, I had the
following:
@nominator = Nominator.new(params)
When I changed it to
@nominator = Nominator.new(params['nominator'])
that cleared it up!
Thanks!
-Sal
On Dec 18, 7:43 pm, Rick DeNatale wrote:
> On Fri, Dec 18, 20
I just wrote a 3-part article on Rails STI here:
http://joemcglynn.wordpress.com
-Original Message-
From: rubyonrails-talk@googlegroups.com
[mailto:rubyonrails-t...@googlegroups.com] On Behalf Of adrianb
Sent: Friday, December 18, 2009 8:48 PM
To: Ruby on Rails: Talk
Subject: [Rails] Re:
I am quite happy with TinyMCE and there is a Rails plugin that
simplifies the usage. If you use ActiveScaffold, it has a bridge that
you can use and have TinyMCE editing in practicly no time. The file
upload is AFAIK supported by a plugin fork
http://github.com/devon/tiny_mce_plus/
but i have not
HELLO I AM DEPRES AND CIK
On Sat, Dec 19, 2009 at 5:08 PM, oubbou wrote:
> Hello everybody,
> I'm ruby/ror newbie
>
> I'm trying to generate a site map of a website. Website is divided to
> three parts (each has own controller). In every controller(in init
> action) is variable @left_menu, which
Hello everybody,
I'm ruby/ror newbie
I'm trying to generate a site map of a website. Website is divided to
three parts (each has own controller). In every controller(in init
action) is variable @left_menu, which is a hash containing a sub-
navigation of current part of the site.
The problem is th
Hi
I have just setup instant rails on a windows box.
I have migrated an app from Linux and I need to install some
additional gems and upgrade rails to be the same version as on the
Linux environment.
I am completely unable to install any gems.
I get messages like the following examples:
E:\gio
Hi dude,
So, to create a model, a controller and layout/views, complety
functional, with basic events CRUD(create read update delete) u open a
terminal, get inside the folder of your app, and write
1)ruby script/generate scaffold ModelName column1:type
column2:type ...columnN:type and hit enter :)
Hi all,
I have a books controller in which i have a list of all books displayed.
I want to have a csv download option.
The point is that i want csv download according to the pagination.
When i click on first page and click csv download i need to get only first 2
records(per page=>2)
When i cli
Hey guys,
i ran in some trouble while making an important app for school, and
the deadline is so soon, that i took a desperate decision, bother
you..
I will put up the code here, and if anyone has a solution, it would
mean the world to me and my work.
My problem is this line of code li.product =
Use Ruby's other regexp syntax:
%r{pattern}
To continue your example below:
validates_format_of :url, :with => %r{^[-\w_./]+$}
AlwaysCharging wrote:
> In my app, I allow users to submit urls. They (of course) need the
> ability to submit urls with a forward slash, "/", but whats the
> regu
Sven Riedel wrote:
> /^http:\/\/myhostname\.com\/foo$/i
>
> would become
>
> %r{http://myhostname\.com/foo}i
And of course I forgot the anchors in the second example. So the correct
version is:
%r{^http://myhostname\.com/foo$}i
--
You received this message because you are subscribed to the Go
frogstarr78 wrote:
> Have you tried escaping them "\/"?
Another way would be to use %r, that way you can avoid the leaning
toothpick syndrome alltogether;
/^http:\/\/myhostname\.com\/foo$/i
would become
%r{http://myhostname\.com/foo}i
But before you start piecing your own regexp together have
Have you tried escaping them "\/"?
On Dec 18, 11:01 pm, AlwaysCharging wrote:
> In my app, I allow users to submit urls. They (of course) need the
> ability to submit urls with a forward slash, "/", but whats the
> regular expression to allow them to do that?
>
> I currently use:
>
> validates_f
32 matches
Mail list logo