🧪 Ruby on Rails MCQ Quiz Hub

Ruby on Rails Multiple choice Questions Set 2

Choose a topic to test your knowledge and improve your Ruby on Rails skills

1. what are the main principles of REST?




2. When is it best to use an array rather than a hash?




3. .Describe the TDD cycle.




4. How does a local variable differ from an instance variable when empty?




5. What is a .erb file?




6. What's the best way to describe an object in Ruby?




7. What is a Class?




8. What kind of object is "@title" and what is special about it in Rails?




9. .What does the routes.rb file do with "get pages/home"?




10. Describe a "symbol" in Rails?




11. What is the status code for "success" when throwing a GET?




12. What is the command to print to the screen?




13. What is the main benefit that a Class gets by inheritance from ApplicationController?




14. Name two ways to indicate a "block" in Rails




15. What is an integration test?




16. What is the most special aspect of nil?




17. What is the /spec directory in rails?




18. What's the difference between a hash and an array?




19. What is a controller?




20. how do you define a "status" parameter (within a "tweet" parameter)?




21. .how do you check the logged in user's id?




22. let's say you have a method... def get_tweet @tweet = Tweet.find(params[:id]) end how do you tie an action to that that only kicks in for the edit, update, and destroy methods?




23. How to includes all javascript?




24. what do you use to send messages to the user?




25. .how includes all stylesheet files?




26. how do you make sure your forms don't get hacked?




27. how do you make a link to a zombie's profile with the text of a zombies name?




28. how do you do validate to ensure ":status" exists and that it's length is at least 3 long?




29. what code generates the url "/tweets/new"? (action = new tweet form)




30. How to create multiple hashes inside "params" (like "status" within "tweet")?




31. .how do you make a link?




32. what code generates the url "/tweets"?




33. what do you write to indicate that a tweet from table "tweets" only belongs to one zombie? (from table "zombies")? a) class Tweet validates_presence_of :status end




34. .show errors in object "t"




35. what file corresponds to the "show" method




36. what does "erb" stand for in file_name.erb?




37. what is partial page templates (or partials)?




38. What is scriptlet?




39. ----sets the location and type of your databbase as well as a few other settings (like how long messages will be recorded)




40. how you start a form that matches a model object?




41. how you start a form that doesn't match a model object




42. which web application that integrates data and services from other places on the web




43. how is authenticity token works?




44. In Rails, a test of a model class is called ----------------.




45. In Rails, a test of an individual controller is called ------------------.




46. what test that tests the whole system?




47. A form bound to a model object is called -------.




48. what is called a set of test data?




49. what is a layout?




50. What is Ruby on Rails?




51. .Who wrote Ruby on Rails?




52. .Does Ruby on Rails make app development easier?




53. What does DRY mean?