Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8612859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T04:43:51+00:00 2026-06-12T04:43:51+00:00

Possible Duplicate: In Ruby, what are the vertical lines? This question seems Google-proof, and

  • 0

Possible Duplicate:
In Ruby, what are the vertical lines?

This question seems Google-proof, and I do not know Ruby.

Comparing different presence of |f| at the end of a line in a model description causes content not to be shown. I am just trying to fix a bug in a page that does not provide access to some information in a table.

“What does ||= do in Ruby” about the || does not seem to help.

Here is the suspect code from the broken .rb file:

comma :show_mytable do |f|
    table2 :field2
    table3 :field3
end

but this seems to work, showing the desired fields when activated:

comma :show_mytable do
    table2 :field2
    table3 :field3
end

Could |f| prevent output from showing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T04:43:52+00:00Added an answer on June 12, 2026 at 4:43 am

    In your code, you are passing two variables to the comma method. The first is a symbol called :show_mytable and the second is a block. It is unrelated to the ||= syntax which is conditional assignment.

    Here is an example of how blocks are used in ruby:

    array = [1, 2, 3, 4]
    array.each do |element|
      element + 1
    end 
      #=> 2 3 4 5
    

    When you use a loop(each in this case), you can pass it a variable(element) to give you a way to reference the current element in the loop.

    You can also use curly braces instead of do and end like this:

    array = [1, 2, 3, 4]
    array.each { |e| e + 1 } 
      #=> 2 3 4 5
    

    Since you aren’t looping through anything here I don’t see any reason you could need the |f| in your example.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Ruby block and unparenthesized arguments I'm not sure I understand this syntax
Possible Duplicate: Ruby syntax question: Rational(a, b) and Rational.new!(a, b) I'm in the process
Possible Duplicate: Python or Ruby Interpreter on iOS I just discovered this apps pypad
Possible Duplicate: Why do this Ruby object have two to_s and inspect methods that
Possible Duplicate: How to sum array members in Ruby? Lets say I have this
Possible Duplicate: 'pass parameter by reference' in Ruby? in this example: def test verb
Possible Duplicate: class << self idiom in Ruby I have a quick Ruby question.
Possible Duplicate: Rails 3.1 and Ruby 1.9.3p125: ruby-debug19 still crashes with “Symbol not found:
Possible Duplicate: What does map(&:name) mean in Ruby? In Ruby, I know that if
Possible Duplicate: Ruby code to extract host from URL string I found this module

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.