Advertisement
Guest User

Untitled

a guest
Jul 30th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.46 KB | None | 0 0
  1. <source.ruby><declaration.class.ruby><keyword.control.class.ruby>class</keyword.control.class.ruby> <entity.name.class.ruby>CategoriesController<entity.other.inherited-class.ruby> < ApplicationController</entity.other.inherited-class.ruby></entity.name.class.ruby></declaration.class.ruby>
  2. <declaration.function.method.without-arguments.ruby> <keyword.control.def.ruby>def</keyword.control.def.ruby> <entity.name.function.ruby>index</entity.name.function.ruby></declaration.function.method.without-arguments.ruby>
  3. list
  4. render <constant.other.symbol.ruby>:action</constant.other.symbol.ruby> => <string.quoted.single.ruby>'list'</string.quoted.single.ruby>
  5. <keyword.control.ruby>end</keyword.control.ruby>
  6.  
  7. <declaration.function.method.without-arguments.ruby> <keyword.control.def.ruby>def</keyword.control.def.ruby> <entity.name.function.ruby>list</entity.name.function.ruby></declaration.function.method.without-arguments.ruby>
  8. <variable.other.readwrite.instance.ruby>@category_pages</variable.other.readwrite.instance.ruby>, <variable.other.readwrite.instance.ruby>@categories</variable.other.readwrite.instance.ruby> = paginate <constant.other.symbol.ruby>:categories</constant.other.symbol.ruby>, <constant.other.symbol.ruby>:per_page</constant.other.symbol.ruby> => <constant.numeric.ruby>10</constant.numeric.ruby>
  9. <keyword.control.ruby>end</keyword.control.ruby>
  10.  
  11. <declaration.function.method.without-arguments.ruby> <keyword.control.def.ruby>def</keyword.control.def.ruby> <entity.name.function.ruby>show</entity.name.function.ruby></declaration.function.method.without-arguments.ruby>
  12. <variable.other.readwrite.instance.ruby>@category</variable.other.readwrite.instance.ruby> = <variable.other.constant.ruby>Category</variable.other.constant.ruby>.find(params[<constant.other.symbol.ruby>:id</constant.other.symbol.ruby>])
  13. <keyword.control.ruby>end</keyword.control.ruby>
  14.  
  15. <declaration.function.method.without-arguments.ruby> <keyword.control.def.ruby>def</keyword.control.def.ruby> <entity.name.function.ruby>new</entity.name.function.ruby></declaration.function.method.without-arguments.ruby>
  16. <variable.other.readwrite.instance.ruby>@category</variable.other.readwrite.instance.ruby> = <variable.other.constant.ruby>Category</variable.other.constant.ruby>.<keyword.other.special-method.ruby>new</keyword.other.special-method.ruby>
  17. <keyword.control.ruby>end</keyword.control.ruby>
  18.  
  19. <declaration.function.method.without-arguments.ruby> <keyword.control.def.ruby>def</keyword.control.def.ruby> <entity.name.function.ruby>create</entity.name.function.ruby></declaration.function.method.without-arguments.ruby>
  20. <variable.other.readwrite.instance.ruby>@category</variable.other.readwrite.instance.ruby> = <variable.other.constant.ruby>Category</variable.other.constant.ruby>.<keyword.other.special-method.ruby>new</keyword.other.special-method.ruby>(params[<constant.other.symbol.ruby>:category</constant.other.symbol.ruby>])
  21. <variable.other.readwrite.instance.ruby>@category</variable.other.readwrite.instance.ruby>.creation_date = <variable.other.constant.ruby>Time</variable.other.constant.ruby>.now
  22. <keyword.control.ruby>if</keyword.control.ruby> <variable.other.readwrite.instance.ruby>@category</variable.other.readwrite.instance.ruby>.save
  23. flash[<constant.other.symbol.ruby>:notice</constant.other.symbol.ruby>] = <string.quoted.single.ruby>'Category was successfully created.'</string.quoted.single.ruby>
  24. redirect_to <constant.other.symbol.ruby>:action</constant.other.symbol.ruby> => <string.quoted.single.ruby>'list'</string.quoted.single.ruby>
  25. <keyword.control.ruby>else</keyword.control.ruby>
  26. render <constant.other.symbol.ruby>:action</constant.other.symbol.ruby> => <string.quoted.single.ruby>'new'</string.quoted.single.ruby>
  27. <keyword.control.ruby>end</keyword.control.ruby>
  28. <keyword.control.ruby>end</keyword.control.ruby>
  29.  
  30. <declaration.function.method.without-arguments.ruby> <keyword.control.def.ruby>def</keyword.control.def.ruby> <entity.name.function.ruby>edit</entity.name.function.ruby></declaration.function.method.without-arguments.ruby>
  31. <variable.other.readwrite.instance.ruby>@category</variable.other.readwrite.instance.ruby> = <variable.other.constant.ruby>Category</variable.other.constant.ruby>.find(params[<constant.other.symbol.ruby>:id</constant.other.symbol.ruby>])
  32. <keyword.control.ruby>end</keyword.control.ruby>
  33.  
  34. <declaration.function.method.without-arguments.ruby> <keyword.control.def.ruby>def</keyword.control.def.ruby> <entity.name.function.ruby>update</entity.name.function.ruby></declaration.function.method.without-arguments.ruby>
  35. <variable.other.readwrite.instance.ruby>@category</variable.other.readwrite.instance.ruby> = <variable.other.constant.ruby>Category</variable.other.constant.ruby>.find(params[<constant.other.symbol.ruby>:id</constant.other.symbol.ruby>])
  36. <keyword.control.ruby>if</keyword.control.ruby> <variable.other.readwrite.instance.ruby>@category</variable.other.readwrite.instance.ruby>.update_attributes(params[<constant.other.symbol.ruby>:category</constant.other.symbol.ruby>])
  37. flash[<constant.other.symbol.ruby>:notice</constant.other.symbol.ruby>] = <string.quoted.single.ruby>'Category was successfully updated.'</string.quoted.single.ruby>
  38. redirect_to <constant.other.symbol.ruby>:action</constant.other.symbol.ruby> => <string.quoted.single.ruby>'show'</string.quoted.single.ruby>, <constant.other.symbol.ruby>:id</constant.other.symbol.ruby> => <variable.other.readwrite.instance.ruby>@category</variable.other.readwrite.instance.ruby>
  39. <keyword.control.ruby>else</keyword.control.ruby>
  40. render <constant.other.symbol.ruby>:action</constant.other.symbol.ruby> => <string.quoted.single.ruby>'edit'</string.quoted.single.ruby>
  41. <keyword.control.ruby>end</keyword.control.ruby>
  42. <keyword.control.ruby>end</keyword.control.ruby>
  43.  
  44. <declaration.function.method.without-arguments.ruby> <keyword.control.def.ruby>def</keyword.control.def.ruby> <entity.name.function.ruby>destroy</entity.name.function.ruby></declaration.function.method.without-arguments.ruby>
  45. <variable.other.constant.ruby>Category</variable.other.constant.ruby>.find(params[<constant.other.symbol.ruby>:id</constant.other.symbol.ruby>]).destroy
  46. redirect_to <constant.other.symbol.ruby>:action</constant.other.symbol.ruby> => <string.quoted.single.ruby>'list'</string.quoted.single.ruby>
  47. <keyword.control.ruby>end</keyword.control.ruby>
  48. <keyword.control.ruby>end</keyword.control.ruby>
  49. </source.ruby>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement