Skip to content

Instantly share code, notes, and snippets.

@Carmer
Created March 23, 2016 13:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Carmer/7fd553f3e0b9bb9ed310 to your computer and use it in GitHub Desktop.
Save Carmer/7fd553f3e0b9bb9ed310 to your computer and use it in GitHub Desktop.
@s-espinosa
Copy link

Any reason robot.id would return an array instead of just the id in erb? I have CRUD working, but I'm having to call .first to get .id in my index file, and that seems off.

@theonlyrao
Copy link

Are the conventions regarding single responsibility different when working with views, or are we just ignoring them for now? it seems weird that we would be happy to let a view have the two responsibilities of

  1. populating an html file with data given to it by the controller for the client to see
  2. manipulating data given to it by the controller before populating the file with it, e.g. controller gives @task but view shows <%= @task.name %>. Should the controller just be in the business of giving the view task_name?

I guess the view will have to do some work sometimes, like iterating through a collection in order to present it in a particular format.

@theonlyrao
Copy link

Is YAML special in that it allows you to populate it with ruby instances? I shoved new Skill instances into my database and when I look at the skill_inventory file I can see not only that YAML knows there are ruby instances in there but also that YAML knows what the attributes are.

Is that a convenience to get used to or not?

@theonlyrao
Copy link

is there an equivalent to using binding.pry in sinatra? I tried to use it to see what was available in a method in one of my models but the terminal interface was so laggy or unresponsive that I basically couldn't use it. Maybe that's just me.

@Claudia108
Copy link

The skill-inventory repo was set up with creating the Yaml::Store in the skill_inventory.rb as a self method. And the app was set up like this: set :root, File.join(File.dirname(FILE), '..') I got an error: "NoMethod error" and "no method join for string". I changed it to create the Yaml::Store and the SkillInventory class in the app file as we had done in Task Manager and then it worked. How would it work with the original setup?

@thomschlereth
Copy link

if we hadn't put the gem shotgun in the gem file, would we still need to specify the server to use for webrick?

@marinacor1
Copy link

When we add code to application.css, what's the general rule for what will be overwritten by the application.css file and what won't be overwritten?

@seeker105
Copy link

would we be able to use "app//.rb" to require files in 'models' and 'controllers' together?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment