@Frederic (Aug 12, 2010 at 15:20):
I agree with you, that railscasts.com is abused as a linkfarm. Removing the URL would be one step (and I second your recommendation).
But I think those spam comment are automagically generated. So these comets would be posted anyway. But without links.
I don't think, that those spamers care if some of their messages don't work as intended.
For forking and improving:
http://github.com/subwindow/negative-captcha
http://rdoc.info/projects/matthutchinson/acts_as_textcaptcha
As an alternative to downloading the jQuery rails.js file manually, you can use "rails g jquery:install" from the rails3-generators gem to install jquery and rails.js, and set the :defaults option to jquery instead of prototype.
One problem with RVM is that it assumes that you use BASH as your default shell :(
/usr/local/lib/rvm should figure out what the current user's default shell is (via /etc/passwd) and then emit appropriate code for whatever shell that is - e.g. tcsh, csh, or bash, sh
This is a typical spam comment: a partial copy/past of a previous comment (here, from the comment you did last Wednesday at 17:28), with the poster name linked to the spammer website.
No need to reply to such spam messages, just use the "Report as spam" link to eradicate those irrelevant posts.
I am trying to include the add and remove links in an app I am writing. The add part was easy, but I am having no luck with remove. I have tried a few variations shown below..
<div id="person">
This is a test.
<%= link_to_function "Delete", "this.up('.person').remove()" %>
</div>
this.up("person") is undefined
Line 1
<div id="person">
This is a test.
<%= link_to_function "Delete", "$(this).up('person').remove()" %>
</div>
$(this).up("person") is undefined
I can't get scrapi running under snow leopard as it seems that not only do you need a new libtidy.dylib you also new a new .so, which I can't seem to find anywhere!
I am not sure why scrapi requires all these binaries and doesn't just use what is installed.
My 2 cents comment about the Spam problem: those tiresome "comments" are only posted because they allow the target site to increase their visibility to search engines by adding a few more links pointing to them.
Remove the "Website URL" field and it will make railscasts.com's attractiveness to dicrease by 100% for the spamers while the rest of the comment functionnality will remain the same for the real users (except perhaps, for those of us who also use this field to improve the visibility of their own blog/corporate website ;-) but I'm pretty sure they will be OK to trade this little "feature" for some reading serenity, won't they?)
Err... I assume this is going to ask me something anti-spam in a second... If not sorry for posting rubbish but the obvious reason why SPAM is so high is because it's so easy to post it.
i know this is an old screencast, but was wondering how do i configure my server -- not application -- to allow users to browse on their own subdomains? i've been told to have my code create new cirtual host files on the server every time a subdomain was created by a user. it this correct? what is everyone else doing? i only ask because i am not a server administrator and don't know diddly about apache.
If you're still getting "{gem_name} is cached, but not installed" errors, the first thing you'd want to try is removing the .bundle and vendor directories.
It's weird that in the session_store.rb file, :domain => :all doesn't work for me (in Edge). :domain => 'lvh.me' does work though... any insights about this?
Ryan, this episode is really useful but it would be great if you can show it in action. For example how do you go about assigning multiple categories to a product and viceversa from the FRONT END. In one of your comments above you mentioned "@Matt and David, I'm planning to do an episode entirely on has_many :through in the near future" But I did not see an episode on has_many :through. Please be kind and do one.
hello I'm having trouble that my application is not recognizing the calendar_for method .. I think this is something have to do with installation of the table_builder because I had to install it manually by installing the zip folder and then copying the file in the vendor?
while executing
rake open_id_authentication:db:create
I am getting an error:
rake aborted!
Don't know how to build task 'open_id_authentication:db:create'
(See full trace by running task with --trace)
Please take a look on the issue. Using rails 2.3.5
I agree with the people here. I find the comments also very helpful. Captcha is very easy to add right? I imagine that Ryan is already busy. Ryan do you want some of us fork your site and add captcha to it or something?
I'm with Florian here. I sometimes go through the older 'casts and just to keep things clean, I pick off all the spam. Hope it helps Ryan and thanks for the railscasts!
I like this approach, but one problem is that it breaks the browser forward/back/reload buttons. So for instance, clicking continue will take you forward one step, and then clicking 'reload' will then mistakenly take you forward another step. This can be solved by storing the current step in the view rather than the session - I've shown the changes here: http://pastie.org/1084054
great tutorial as always, very helpful for some of the people who haven't jumped ship yet. But my goodness the spam is getting overwhelming here, I'd suggest at least adding some sort of comment filter.
/Library/Ruby/Site/1.8/rubygems/requirement.rb:72:in `parse': Illformed requirement [""] (ArgumentError)
from /Library/Ruby/Site/1.8/rubygems/requirement.rb:96:in `initialize'
from /Library/Ruby/Site/1.8/rubygems/requirement.rb:96:in `map!'
from /Library/Ruby/Site/1.8/rubygems/requirement.rb:96:in `initialize'
from /Library/Ruby/Site/1.8/rubygems/requirement.rb:35:in `new'
from /Library/Ruby/Site/1.8/rubygems/requirement.rb:35:in `create'
from /Library/Ruby/Site/1.8/rubygems/dependency.rb:61:in `initialize'
from /Library/Ruby/Site/1.8/rubygems.rb:207:in `new'
from /Library/Ruby/Site/1.8/rubygems.rb:207:in `activate'
from /Library/Ruby/Site/1.8/rubygems.rb:1056:in `gem'
from lib/daemons/mailer_ctl:14
Thanks, Ryan for your hard work... Might as well leave comments off since at this point they are worthless. I used to glean knowledge from the comments, now it's a waste.
Small note - the line:
content_for?(:side) ? yield(:side) : render(:partial => 'shared/side')
Can be shortened slightly to
yield(:side).presence || render(:partial => 'shared/side')
Thanks, Ryan!
@Frederic (Aug 12, 2010 at 15:20):
I agree with you, that railscasts.com is abused as a linkfarm. Removing the URL would be one step (and I second your recommendation).
But I think those spam comment are automagically generated. So these comets would be posted anyway. But without links.
I don't think, that those spamers care if some of their messages don't work as intended.
For forking and improving:
http://github.com/subwindow/negative-captcha
http://rdoc.info/projects/matthutchinson/acts_as_textcaptcha
As an alternative to downloading the jQuery rails.js file manually, you can use "rails g jquery:install" from the rails3-generators gem to install jquery and rails.js, and set the :defaults option to jquery instead of prototype.
Useful and nice episode!
There are already a couple of deprecation warnings messages in Rails 2.3.8, especially using rake commands.
Again nice episode!
One problem with RVM is that it assumes that you use BASH as your default shell :(
/usr/local/lib/rvm should figure out what the current user's default shell is (via /etc/passwd) and then emit appropriate code for whatever shell that is - e.g. tcsh, csh, or bash, sh
Today I've rewritten this plugin as a Gem for Rails3.
For more details checkout:
http://rubygems.org/gems/exception_logger
and
http://github.com/QuBiT/exception_logger
And it works ;)
Enjoy and have fun :)
If I attempt to use any generators (e.g. nifty_scaffold or scaffold) the following error is thrown:
uninitialized constant Rails::Generator::GeneratedAttribute::ActiveRecord
I have turned off active record in environment.rb via:
config.frameworks -= [:active_record]
My database.yml file is empty. Everything is configured as per the screencast/mongo docs.
I'm running Rails 2.3.8, mongo 1.0.7, mongo_mapper 0.8.3, and MongoDB 1.6.0.
If anybody else has run in to this error (and found a solution), please comment. Previous comments have alluded to similar problems.
The files could be created manually, however I'm interested as to why this is happening - active record should be disabled.
@de_an777 (Aug 12, 2010 at 03:22):
This is a typical spam comment: a partial copy/past of a previous comment (here, from the comment you did last Wednesday at 17:28), with the poster name linked to the spammer website.
No need to reply to such spam messages, just use the "Report as spam" link to eradicate those irrelevant posts.
thank youuu
@Gabe S —You might have something else depending on the old linecache. As soon as I replaced ruby-debug with ruby-debug19 Ruby 1.9.2 worked for me.
hey Ryan! - Great as always - THANK YOU!
Is there any way you are aware of to show multiple graphs in a view and be able to print to pdf?
Maybe it doesnt exist?!
Thanks again! ak.
thanksss admin
thank you admin thanksss
thank youuu:)
I am trying to include the add and remove links in an app I am writing. The add part was easy, but I am having no luck with remove. I have tried a few variations shown below..
<div id="person">
This is a test.
<%= link_to_function "Delete", "this.up('.person').remove()" %>
</div>
this.up("person") is undefined
Line 1
<div id="person">
This is a test.
<%= link_to_function "Delete", "$(this).up('person').remove()" %>
</div>
$(this).up("person") is undefined
Any help would be appreciated
Bob
I am trying to use table_builder but
I am getting on ROR 2.3.8:
undefined method `safe_concat' for #<ActionView::Base:0x10217d8a8>
Any ideas?
Thanks
Hi Ryan, nice work but i need the permission logic in the database, i can't figured out how to make the models (rol and permission). You can help me?
Thanx
I can't get scrapi running under snow leopard as it seems that not only do you need a new libtidy.dylib you also new a new .so, which I can't seem to find anywhere!
I am not sure why scrapi requires all these binaries and doesn't just use what is installed.
How to cache the PDF using Rails page caching and PDFKit
1. Disable the PDFKit middleware so that your controller handles the generation of the PDF.
2. Register PDF as a mime-type in environment.rb:
Mime::Type.register "application/pdf", :pdf
3. In your controller, cache pages just like normal with caches_page :show
4. create a format.pdf call in your respond_to block and init a new PDFKit object, pass in the url to the current action and call to.pdf on it.
respond_to do |format|
format.html # show.html.erb
format.pdf { render :text => PDFKit.new( post_url(@post) ).to_pdf }
end
Now in your cache directory you'll create two cache files - one .html and one .pdf.
My 2 cents comment about the Spam problem: those tiresome "comments" are only posted because they allow the target site to increase their visibility to search engines by adding a few more links pointing to them.
Remove the "Website URL" field and it will make railscasts.com's attractiveness to dicrease by 100% for the spamers while the rest of the comment functionnality will remain the same for the real users (except perhaps, for those of us who also use this field to improve the visibility of their own blog/corporate website ;-) but I'm pretty sure they will be OK to trade this little "feature" for some reading serenity, won't they?)
Hi Ryan,
I assume you know there is no anti-spam on comments which would explain any recent SPAM :(
HTH!
Adam
Err... I assume this is going to ask me something anti-spam in a second... If not sorry for posting rubbish but the obvious reason why SPAM is so high is because it's so easy to post it.
testing
Captcha in place?
test
This was really useful. Thanks Ryan!
very nice
i know this is an old screencast, but was wondering how do i configure my server -- not application -- to allow users to browse on their own subdomains? i've been told to have my code create new cirtual host files on the server every time a subdomain was created by a user. it this correct? what is everyone else doing? i only ask because i am not a server administrator and don't know diddly about apache.
AR,
If you're still getting "{gem_name} is cached, but not installed" errors, the first thing you'd want to try is removing the .bundle and vendor directories.
Good luck!
@george (#35) : I agree.
It's weird that in the session_store.rb file, :domain => :all doesn't work for me (in Edge). :domain => 'lvh.me' does work though... any insights about this?
@docgecko (#2) : devise works fine for me here.
Ryan, this episode is really useful but it would be great if you can show it in action. For example how do you go about assigning multiple categories to a product and viceversa from the FRONT END. In one of your comments above you mentioned "@Matt and David, I'm planning to do an episode entirely on has_many :through in the near future" But I did not see an episode on has_many :through. Please be kind and do one.
@directory list
I asked the same question, read comment 14 for the answer, it has a download of the theme and everything.
@Bowser, Sr.
Thanks a lot dude! Really appreciate it!
@de_an777
You can find info on the railscast textmate theme and fonts here:
http://railscasts.com/about
I was wondering what theme you use in textmate. I really like the way it looks, does anyone know where I can find it? Thanks a lot!
Also, awesome screencast, super useful! Best rails screencast site I've been to.
Ryan,
Thanks for the populator gem. In case anyone else is looking for HTML formatted paragraphs, the following method addition to random.rb is what I use:
def hparagraphs(total)
(1..interpret_value(total)).map do
"<p>"
sentences(3..8).capitalize
end.join(".</p>")
end
I have a model with a few Paperclip attachments associated with it.
Let's say I am validating for a non-Paperclip field, but the user selects an image on their computer and submits the form.
The validation fails for the non-Paperclip field, but now the selected image is now gone.
Is there any way to save the location of the local file so that the user doesn't need to reselect the file?
Thanks,
Andy
hello I'm having trouble that my application is not recognizing the calendar_for method .. I think this is something have to do with installation of the table_builder because I had to install it manually by installing the zip folder and then copying the file in the vendor?
does anyone know what I'm doing wrong?
while executing
rake open_id_authentication:db:create
I am getting an error:
rake aborted!
Don't know how to build task 'open_id_authentication:db:create'
(See full trace by running task with --trace)
Please take a look on the issue. Using rails 2.3.5
I agree with the people here. I find the comments also very helpful. Captcha is very easy to add right? I imagine that Ryan is already busy. Ryan do you want some of us fork your site and add captcha to it or something?
Btw this episode becomes really handy!
I'm with Florian here. I sometimes go through the older 'casts and just to keep things clean, I pick off all the spam. Hope it helps Ryan and thanks for the railscasts!
Also, should validation really be done when clicking the back button?
I like this approach, but one problem is that it breaks the browser forward/back/reload buttons. So for instance, clicking continue will take you forward one step, and then clicking 'reload' will then mistakenly take you forward another step. This can be solved by storing the current step in the view rather than the session - I've shown the changes here: http://pastie.org/1084054
great tutorial as always, very helpful for some of the people who haven't jumped ship yet. But my goodness the spam is getting overwhelming here, I'd suggest at least adding some sort of comment filter.
Thanks a million helmerj that really helped me
Here is the error i am getting
/Library/Ruby/Site/1.8/rubygems/requirement.rb:72:in `parse': Illformed requirement [""] (ArgumentError)
from /Library/Ruby/Site/1.8/rubygems/requirement.rb:96:in `initialize'
from /Library/Ruby/Site/1.8/rubygems/requirement.rb:96:in `map!'
from /Library/Ruby/Site/1.8/rubygems/requirement.rb:96:in `initialize'
from /Library/Ruby/Site/1.8/rubygems/requirement.rb:35:in `new'
from /Library/Ruby/Site/1.8/rubygems/requirement.rb:35:in `create'
from /Library/Ruby/Site/1.8/rubygems/dependency.rb:61:in `initialize'
from /Library/Ruby/Site/1.8/rubygems.rb:207:in `new'
from /Library/Ruby/Site/1.8/rubygems.rb:207:in `activate'
from /Library/Ruby/Site/1.8/rubygems.rb:1056:in `gem'
from lib/daemons/mailer_ctl:14
Thanks Ryan!
I agree with Iar but sometimes people really share something of worth in the comments. I think adding a captcha would help a lot.
Thanks again!
Thanks, Ryan for your hard work... Might as well leave comments off since at this point they are worthless. I used to glean knowledge from the comments, now it's a waste.