Home > The Error > The Error Occurred While Evaluating Nil.gsub

The Error Occurred While Evaluating Nil.gsub

Not the answer you're looking for? The cleanest solution is to simply remove the "@file =" from the front: @file.gsub!(/^.*(\\|\/)/, '') # replace html tags with blank But you could also remove the ! Our announcement can be found here: http://softiesonrails.com/articles/2006/07/28/rails-training-for-microsoft-developers Thanks! Thanks Anthony. weblink

Browse other questions tagged ruby-on-rails-3 acts-as-taggable-on or ask your own question. Automating Project Setup What to do when majority of the students do not bother to do peer grading assignment? Posted: Wed Jul 16, 2008 4:48 pm Post subject: Need advice for code in NetBeans Rails/JRuby tutorials On Tue, Jul 15, 2008 at 5:12 PM, Chris Kutler wrote: Quote: Posted: Wed Jul 16, 2008 12:12 am Post subject: Need advice for code in NetBeans Rails/JRuby tutorials undefined method `sanitize' for HTML::Sanitizer:Class Can you help this poor newby figure out http://stackoverflow.com/questions/9708804/the-error-occurred-while-evaluating-nil-sort-by

Can I image Amiga Floppy Disks on a Modern computer? and keep the variable assignment: @file = @file.gsub(/^.*(\\|\/)/, '') # replace html tags with blank David [email protected] Fird Abrar wrote: > #{RAILS_ROOT}/app/controllers/start_controller.rb:13:in `create' > --- > > class StartController < ApplicationController Perhaps you meant in the first line to get keywords from the params array? @tags = Article.tag_counts_on(params[:keywords]) Also, you need to handle the case where no tags are found, right? Perhaps you meant @contacts = @contacts.sort_by... –Phrogz Dec 7 '10 at 21:11 Yes, you need to, in general, suffix array methods with a '!' for them to modify the

before sorting to ensure you have no nil values in the array. In a World Where Gods Exist Why Wouldn't Every Nation Be Theocratic? Here it is for anyone else who wants to work with the date_box like I wanted to. Posted: Tue Jul 15, 2008 2:51 pm Post subject: Need advice for code in NetBeans Rails/JRuby tutorials Or to expand a bit on what Anthony posted - def speak voice

NetBeans IDE NetBeans Platform Plugins Docs & Support Community Partners HOME / NetBeans forums NetBeans Forums FAQ Search Memberlist Register Profile Log in to check your private messages Log in Posted: Tue Jul 15, 2008 2:54 pm Post subject: Need advice for code in NetBeans Rails/JRuby tutorials Also, Post as a model name is a bad idea, since 'post' is How can I handle auto-linking the email address in this situation? Source The error occured while evaluating nil.gsub On line #28 of app/views/personnel/list.rhtml 25: 26: <% display_columns = ["username", "preferred_name", "email", "title"] %> 27: <% display_columns.each do |column|

It changes the definition and I didn't touch every aspect of the engine - only the piece that I was interested in. Currently, it errors out on the call to gsub with the following: def speak # Get and allocate a voice voice = VoiceManager.getInstance. and I guess the error is trying to be helpful since sort_by is a method of Array. Output a googol copies of a string Dozens of earthworms came on my terrace and died there ATBAP or single entry - What are the admission fees for CA national parks?

My AccountSearchMapsYouTubePlayNewsGmailDriveCalendarGoogle+TranslatePhotosMoreShoppingWalletFinanceDocsBooksBloggerContactsHangoutsEven more from GoogleSign inHidden fieldsSearch for groups or messages ようこそゲストさん ブログトップ 記事一覧 ログイン無料ブログ開設 Slow Dance <[Web全般]docomoの携帯アドレス...|[Rails][Ruby]Hash引数便利よね> 2008-02-13 render :templateで意味不明なエラーにはまった Rails やったこと コントローラで、動的コンテンツのURLを生成し、それをビューで表示するロジックを書いた。 def show @content = Content.find_by_id(params[:id]) @url http://osdir.com/ml/RubyonRailsTalk/2006-07/msg06654.html That indicates that the substitution should take place in the original string. Here is what I wanted: <%= date_box( 'model_name', 'field_name_for_date1' ) %> <%= date_box( 'model_name', 'field_name_for_date2' ) %> etc... share|improve this answer answered Mar 14 '12 at 20:10 Tom Harrison Jr 7,69722665 probably you have right.

So, why is @tags nil? have a peek at these guys How to say each other on this sentence Centered-justified or right-justified DDoS: Why not block originating IP addresses? http://www.netbeans.org/issues/show_bug.cgi?id=140193 Thanks, Chris James Moore wrote: Quote: Quote: On Tue, Jul 15, 2008 at 7:53 AM, James Moore ([email protected]) wrote: Quote: Also, Post as a model name is Not the answer you're looking for?

Active record gives you the ORM functionality to your model classes. Why is international first class much more expensive than international economy class? Date Index Thread: Prev Next Thread Index #{RAILS_ROOT}/app/controllers/start_controller.rb:13:in `create' --- class StartController < ApplicationController def create #------------Remove Tag--------------------------- @name = params[:name] @file = params[:filepath] @file = @file.gsub!(/^.*(\\|\/)/, '') # replace html check over here I'm not sure if I can post this here or not.

How to deal with being asked to smile more? In it, you'll get: The week's top questions and answers Important community announcements Questions that need answers see an example newsletter By subscribing, you agree to the privacy policy and terms If you have any questions or need clarification then let me know.

I've seen solutions that suggest reading the file using IO, then splitting by ";" and executing, but that seems a bit much for a relatively simple command.

Posted: Tue Jul 15, 2008 2:59 pm Post subject: Need advice for code in NetBeans Rails/JRuby tutorials On Tue, Jul 15, 2008 at 7:53 AM, James Moore wrote: Quote: I appreciate your help. Why does Fleur say "zey, ze" instead of "they, the" in Harry Potter? Back to top Anthony RichardsonPosted via mailing list.

Posted: Wed Jul 16, 2008 12:21 am Post subject: Need advice for code in NetBeans Rails/JRuby tutorials When I changed voice = VoiceManager.getInstance.getVoice('kevin16') to voice = VoiceManager.instance.voice('kevin16') I got Quote: GBiz is too! Latest News Stories: Docker 1.0Heartbleed Redux: Another Gaping Wound in Web Encryption UncoveredThe Next Circle of Hell: Unpatchable SystemsGit 2.0.0 ReleasedThe Linux Foundation Announces Core Infrastructure You might want to double-check that on the JRuby mailing list. this content Here is some code in a tutorial that I am writing: The QE reviewer wants me to tighten up the code to handle the situation where Post.find returns null.

YouTube Videos: Google returns non-existant meta description and different keywords Raise equation number position from new line Does the mass of sulfur really decrease when dissolved in water and increase when It is the domain object. Can anyone help out here? getVoice('kevin16') voice.allocate # Get the text to speak and remove markup post = Post.find(params[:id]) if post then title = post.title.gsub(/<.*?>/, "") body = post.body.gsub(/<.*?>/, "") # Speak the text voice.speak(title) voice.speak(body)

Is Certificate validation done completely local? Currently, it errors out on the call to gsub with the following: Actually, you don't need to guard find when called with an ID. getVoice('kevin16') voice.allocate # Get the text to speak and remove markup post = Post.find(params[:id]) if post then title = post.title.gsub(/<.*?>/, "") body = post.body.gsub(/<.*?>/, "") # Speak the text voice.speak(title) voice.speak(body) and keep the variable assignment: > > @file = @file.gsub(/^.*(\\|\/)/, '') # replace html tags with blank > > > David > [email protected] > > Fird Abrar wrote: >> #{RAILS_ROOT}/app/controllers/start_controller.rb:13:in `create'

That indicates that the substitution should take place in the original string. Currently, it errors out on the call to gsub with the following: NoMethodError in PostsController#speak You have a nil object when you didn't expect it! I'd rename it. -- James Moore [email protected] blog.restphone.com And use Ruby style for the java getters: voice = VoiceManager.instance.voice('kevin16') (I'm assuming VoiceManager is a Java thing, given those old-fashioned getSomething calls) I'd rename it. -- James Moore [email protected] blog.restphone.com And use Ruby style for the java getters: voice = VoiceManager.instance.voice('kevin16') (I'm assuming VoiceManager is a Java thing, given those old-fashioned getSomething calls)

more stack exchange communities company blog Stack Exchange Inbox Reputation and Badges sign up log in tour help Tour Start here for a quick overview of the site Help Center Detailed Lengthwise or widthwise. I made this change to meet my needs and hopefully others will get some use of it too. Next Message by Date: [Rails] can someone explain RoR MVC from a C++ or Java perspective?

Then again, if I'd had my first cup of coffee already I'd have noticed that the REAL problem is that @file is nil, so you'll need to examine how @file is I made the choice to go with the datebox engine. when in console write Article.tag_counts_on(:keyworld) I take an empty hash: => []. which is consisent with other form helpers (minus the options hash).

and have a nil object? Fire up rails console (in your project directory) and execute Article.tag_counts_on('something') -- where 'something' is a keyword. View is similar to jsp pages.