# Last name : <%= f.text_field :last_name %>
@@ -145,7 +145,7 @@ module ActionView # If the instance variable is not @person you can pass the actual # record as the second argument: # - # <%= form_for :person, person, :url => { :action => "update" } do |f| %> + # <%= form_for :person, person, :url => { :action => "create" } do |f| %> # ... # <% end %> # @@ -177,7 +177,7 @@ module ActionView # possible to use both the stand-alone FormHelper methods and methods # from FormTagHelper. For example: # - # <%= form_for :person, @person, :url => { :action => "update" } do |f| %> + # <%= form_for :person, @person, :url => { :action => "create" } do |f| %> # First name: <%= f.text_field :first_name %> # Last name : <%= f.text_field :last_name %> # Biography : <%= text_area :person, :biography %> @@ -265,7 +265,7 @@ module ActionView # custom builder. For example, let's say you made a helper to # automatically add labels to form inputs. # - # <%= form_for :person, @person, :url => { :action => "update" }, :builder => LabellingFormBuilder do |f| %> + # <%= form_for :person, @person, :url => { :action => "create" }, :builder => LabellingFormBuilder do |f| %> # <%= f.text_field :first_name %> # <%= f.text_field :last_name %> # <%= text_area :person, :biography %> @@ -342,7 +342,7 @@ module ActionView # # === Generic Examples # - # <%= form_for @person, :url => { :action => "update" } do |person_form| %> + # <%= form_for @person do |person_form| %> # First name: <%= person_form.text_field :first_name %> # Last name : <%= person_form.text_field :last_name %> # @@ -354,13 +354,13 @@ module ActionView # ...or if you have an object that needs to be represented as a different # parameter, like a Client that acts as a Person: # - # <%= fields_for :person, @client do |permission_fields| %> + # <%= fields_for :person, @client, :url => { :action => "create" } do |permission_fields| %> # Admin?: <%= permission_fields.check_box :admin %> # <% end %> # # ...or if you don't have an object, just a name of the parameter: # - # <%= fields_for :person do |permission_fields| %> + # <%= fields_for :person, :url => { :action => "create" } do |permission_fields| %> # Admin?: <%= permission_fields.check_box :admin %> # <% end %> # @@ -404,7 +404,7 @@ module ActionView # # This model can now be used with a nested fields_for, like so: # - # <%= form_for @person, :url => { :action => "update" } do |person_form| %> + # <%= form_for @person do |person_form| %> # ... # <%= person_form.fields_for :address do |address_fields| %> # Street : <%= address_fields.text_field :street %> @@ -433,7 +433,7 @@ module ActionView # with a value that evaluates to +true+, you will destroy the associated # model (eg. 1, '1', true, or 'true'): # - # <%= form_for @person, :url => { :action => "update" } do |person_form| %> + # <%= form_for @person do |person_form| %> # ... # <%= person_form.fields_for :address do |address_fields| %> # ... @@ -461,7 +461,7 @@ module ActionView # the nested fields_for call will be repeated for each instance in the # collection: # - # <%= form_for @person, :url => { :action => "update" } do |person_form| %> + # <%= form_for @person do |person_form| %> # ... # <%= person_form.fields_for :projects do |project_fields| %> # <% if project_fields.object.active? %> @@ -472,7 +472,7 @@ module ActionView # # It's also possible to specify the instance to be used: # - # <%= form_for @person, :url => { :action => "update" } do |person_form| %> + # <%= form_for @person do |person_form| %> # ... # <% @person.projects.each do |project| %> # <% if project.active? %> @@ -485,7 +485,7 @@ module ActionView # # Or a collection to be used: # - # <%= form_for @person, :url => { :action => "update" } do |person_form| %> + # <%= form_for @person do |person_form| %> # ... # <%= person_form.fields_for :projects, @active_projects do |project_fields| %> # Name: <%= project_fields.text_field :name %> @@ -514,7 +514,7 @@ module ActionView # parameter with a value that evaluates to +true+ # (eg. 1, '1', true, or 'true'): # - # <%= form_for @person, :url => { :action => "update" } do |person_form| %> + # <%= form_for @person do |person_form| %> # ... # <%= person_form.fields_for :projects do |project_fields| %> # Delete: <%= project_fields.check_box :_destroy %> diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 37b379af9e..5f741c6ae7 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -1572,7 +1572,7 @@ module ActiveRecord #:nodoc: # or nil if this record's unsaved. # # For example, suppose that you have a User model, and that you have a - # map.resources :users route. Normally, +user_path+ will + # resources :users route. Normally, +user_path+ will # construct a path with the user object's 'id' in it: # # user = User.find_by_name('Phusion') diff --git a/railties/guides/images/belongs_to.png b/railties/guides/assets/images/belongs_to.png similarity index 100% rename from railties/guides/images/belongs_to.png rename to railties/guides/assets/images/belongs_to.png diff --git a/railties/guides/images/book_icon.gif b/railties/guides/assets/images/book_icon.gif similarity index 100% rename from railties/guides/images/book_icon.gif rename to railties/guides/assets/images/book_icon.gif diff --git a/railties/guides/images/bullet.gif b/railties/guides/assets/images/bullet.gif similarity index 100% rename from railties/guides/images/bullet.gif rename to railties/guides/assets/images/bullet.gif diff --git a/railties/guides/images/challenge.png b/railties/guides/assets/images/challenge.png similarity index 100% rename from railties/guides/images/challenge.png rename to railties/guides/assets/images/challenge.png diff --git a/railties/guides/images/chapters_icon.gif b/railties/guides/assets/images/chapters_icon.gif similarity index 100% rename from railties/guides/images/chapters_icon.gif rename to railties/guides/assets/images/chapters_icon.gif diff --git a/railties/guides/images/check_bullet.gif b/railties/guides/assets/images/check_bullet.gif similarity index 100% rename from railties/guides/images/check_bullet.gif rename to railties/guides/assets/images/check_bullet.gif diff --git a/railties/guides/images/credits_pic_blank.gif b/railties/guides/assets/images/credits_pic_blank.gif similarity index 100% rename from railties/guides/images/credits_pic_blank.gif rename to railties/guides/assets/images/credits_pic_blank.gif diff --git a/railties/guides/images/csrf.png b/railties/guides/assets/images/csrf.png similarity index 100% rename from railties/guides/images/csrf.png rename to railties/guides/assets/images/csrf.png diff --git a/railties/guides/images/customized_error_messages.png b/railties/guides/assets/images/customized_error_messages.png similarity index 100% rename from railties/guides/images/customized_error_messages.png rename to railties/guides/assets/images/customized_error_messages.png diff --git a/railties/guides/images/edge_badge.png b/railties/guides/assets/images/edge_badge.png similarity index 100% rename from railties/guides/images/edge_badge.png rename to railties/guides/assets/images/edge_badge.png diff --git a/railties/guides/images/error_messages.png b/railties/guides/assets/images/error_messages.png similarity index 100% rename from railties/guides/images/error_messages.png rename to railties/guides/assets/images/error_messages.png diff --git a/railties/guides/images/feature_tile.gif b/railties/guides/assets/images/feature_tile.gif similarity index 100% rename from railties/guides/images/feature_tile.gif rename to railties/guides/assets/images/feature_tile.gif diff --git a/railties/guides/images/footer_tile.gif b/railties/guides/assets/images/footer_tile.gif similarity index 100% rename from railties/guides/images/footer_tile.gif rename to railties/guides/assets/images/footer_tile.gif diff --git a/railties/guides/images/fxn.png b/railties/guides/assets/images/fxn.png similarity index 100% rename from railties/guides/images/fxn.png rename to railties/guides/assets/images/fxn.png diff --git a/railties/guides/images/grey_bullet.gif b/railties/guides/assets/images/grey_bullet.gif similarity index 100% rename from railties/guides/images/grey_bullet.gif rename to railties/guides/assets/images/grey_bullet.gif diff --git a/railties/guides/images/habtm.png b/railties/guides/assets/images/habtm.png similarity index 100% rename from railties/guides/images/habtm.png rename to railties/guides/assets/images/habtm.png diff --git a/railties/guides/images/has_many.png b/railties/guides/assets/images/has_many.png similarity index 100% rename from railties/guides/images/has_many.png rename to railties/guides/assets/images/has_many.png diff --git a/railties/guides/images/has_many_through.png b/railties/guides/assets/images/has_many_through.png similarity index 100% rename from railties/guides/images/has_many_through.png rename to railties/guides/assets/images/has_many_through.png diff --git a/railties/guides/images/has_one.png b/railties/guides/assets/images/has_one.png similarity index 100% rename from railties/guides/images/has_one.png rename to railties/guides/assets/images/has_one.png diff --git a/railties/guides/images/has_one_through.png b/railties/guides/assets/images/has_one_through.png similarity index 100% rename from railties/guides/images/has_one_through.png rename to railties/guides/assets/images/has_one_through.png diff --git a/railties/guides/images/header_backdrop.png b/railties/guides/assets/images/header_backdrop.png similarity index 100% rename from railties/guides/images/header_backdrop.png rename to railties/guides/assets/images/header_backdrop.png diff --git a/railties/guides/images/header_tile.gif b/railties/guides/assets/images/header_tile.gif similarity index 100% rename from railties/guides/images/header_tile.gif rename to railties/guides/assets/images/header_tile.gif diff --git a/railties/guides/images/i18n/demo_localized_pirate.png b/railties/guides/assets/images/i18n/demo_localized_pirate.png similarity index 100% rename from railties/guides/images/i18n/demo_localized_pirate.png rename to railties/guides/assets/images/i18n/demo_localized_pirate.png diff --git a/railties/guides/images/i18n/demo_translated_en.png b/railties/guides/assets/images/i18n/demo_translated_en.png similarity index 100% rename from railties/guides/images/i18n/demo_translated_en.png rename to railties/guides/assets/images/i18n/demo_translated_en.png diff --git a/railties/guides/images/i18n/demo_translated_pirate.png b/railties/guides/assets/images/i18n/demo_translated_pirate.png similarity index 100% rename from railties/guides/images/i18n/demo_translated_pirate.png rename to railties/guides/assets/images/i18n/demo_translated_pirate.png diff --git a/railties/guides/images/i18n/demo_translation_missing.png b/railties/guides/assets/images/i18n/demo_translation_missing.png similarity index 100% rename from railties/guides/images/i18n/demo_translation_missing.png rename to railties/guides/assets/images/i18n/demo_translation_missing.png diff --git a/railties/guides/images/i18n/demo_untranslated.png b/railties/guides/assets/images/i18n/demo_untranslated.png similarity index 100% rename from railties/guides/images/i18n/demo_untranslated.png rename to railties/guides/assets/images/i18n/demo_untranslated.png diff --git a/railties/guides/images/icons/README b/railties/guides/assets/images/icons/README similarity index 100% rename from railties/guides/images/icons/README rename to railties/guides/assets/images/icons/README diff --git a/railties/guides/images/icons/callouts/1.png b/railties/guides/assets/images/icons/callouts/1.png similarity index 100% rename from railties/guides/images/icons/callouts/1.png rename to railties/guides/assets/images/icons/callouts/1.png diff --git a/railties/guides/images/icons/callouts/10.png b/railties/guides/assets/images/icons/callouts/10.png similarity index 100% rename from railties/guides/images/icons/callouts/10.png rename to railties/guides/assets/images/icons/callouts/10.png diff --git a/railties/guides/images/icons/callouts/11.png b/railties/guides/assets/images/icons/callouts/11.png similarity index 100% rename from railties/guides/images/icons/callouts/11.png rename to railties/guides/assets/images/icons/callouts/11.png diff --git a/railties/guides/images/icons/callouts/12.png b/railties/guides/assets/images/icons/callouts/12.png similarity index 100% rename from railties/guides/images/icons/callouts/12.png rename to railties/guides/assets/images/icons/callouts/12.png diff --git a/railties/guides/images/icons/callouts/13.png b/railties/guides/assets/images/icons/callouts/13.png similarity index 100% rename from railties/guides/images/icons/callouts/13.png rename to railties/guides/assets/images/icons/callouts/13.png diff --git a/railties/guides/images/icons/callouts/14.png b/railties/guides/assets/images/icons/callouts/14.png similarity index 100% rename from railties/guides/images/icons/callouts/14.png rename to railties/guides/assets/images/icons/callouts/14.png diff --git a/railties/guides/images/icons/callouts/15.png b/railties/guides/assets/images/icons/callouts/15.png similarity index 100% rename from railties/guides/images/icons/callouts/15.png rename to railties/guides/assets/images/icons/callouts/15.png diff --git a/railties/guides/images/icons/callouts/2.png b/railties/guides/assets/images/icons/callouts/2.png similarity index 100% rename from railties/guides/images/icons/callouts/2.png rename to railties/guides/assets/images/icons/callouts/2.png diff --git a/railties/guides/images/icons/callouts/3.png b/railties/guides/assets/images/icons/callouts/3.png similarity index 100% rename from railties/guides/images/icons/callouts/3.png rename to railties/guides/assets/images/icons/callouts/3.png diff --git a/railties/guides/images/icons/callouts/4.png b/railties/guides/assets/images/icons/callouts/4.png similarity index 100% rename from railties/guides/images/icons/callouts/4.png rename to railties/guides/assets/images/icons/callouts/4.png diff --git a/railties/guides/images/icons/callouts/5.png b/railties/guides/assets/images/icons/callouts/5.png similarity index 100% rename from railties/guides/images/icons/callouts/5.png rename to railties/guides/assets/images/icons/callouts/5.png diff --git a/railties/guides/images/icons/callouts/6.png b/railties/guides/assets/images/icons/callouts/6.png similarity index 100% rename from railties/guides/images/icons/callouts/6.png rename to railties/guides/assets/images/icons/callouts/6.png diff --git a/railties/guides/images/icons/callouts/7.png b/railties/guides/assets/images/icons/callouts/7.png similarity index 100% rename from railties/guides/images/icons/callouts/7.png rename to railties/guides/assets/images/icons/callouts/7.png diff --git a/railties/guides/images/icons/callouts/8.png b/railties/guides/assets/images/icons/callouts/8.png similarity index 100% rename from railties/guides/images/icons/callouts/8.png rename to railties/guides/assets/images/icons/callouts/8.png diff --git a/railties/guides/images/icons/callouts/9.png b/railties/guides/assets/images/icons/callouts/9.png similarity index 100% rename from railties/guides/images/icons/callouts/9.png rename to railties/guides/assets/images/icons/callouts/9.png diff --git a/railties/guides/images/icons/caution.png b/railties/guides/assets/images/icons/caution.png similarity index 100% rename from railties/guides/images/icons/caution.png rename to railties/guides/assets/images/icons/caution.png diff --git a/railties/guides/images/icons/example.png b/railties/guides/assets/images/icons/example.png similarity index 100% rename from railties/guides/images/icons/example.png rename to railties/guides/assets/images/icons/example.png diff --git a/railties/guides/images/icons/home.png b/railties/guides/assets/images/icons/home.png similarity index 100% rename from railties/guides/images/icons/home.png rename to railties/guides/assets/images/icons/home.png diff --git a/railties/guides/images/icons/important.png b/railties/guides/assets/images/icons/important.png similarity index 100% rename from railties/guides/images/icons/important.png rename to railties/guides/assets/images/icons/important.png diff --git a/railties/guides/images/icons/next.png b/railties/guides/assets/images/icons/next.png similarity index 100% rename from railties/guides/images/icons/next.png rename to railties/guides/assets/images/icons/next.png diff --git a/railties/guides/images/icons/note.png b/railties/guides/assets/images/icons/note.png similarity index 100% rename from railties/guides/images/icons/note.png rename to railties/guides/assets/images/icons/note.png diff --git a/railties/guides/images/icons/prev.png b/railties/guides/assets/images/icons/prev.png similarity index 100% rename from railties/guides/images/icons/prev.png rename to railties/guides/assets/images/icons/prev.png diff --git a/railties/guides/images/icons/tip.png b/railties/guides/assets/images/icons/tip.png similarity index 100% rename from railties/guides/images/icons/tip.png rename to railties/guides/assets/images/icons/tip.png diff --git a/railties/guides/images/icons/up.png b/railties/guides/assets/images/icons/up.png similarity index 100% rename from railties/guides/images/icons/up.png rename to railties/guides/assets/images/icons/up.png diff --git a/railties/guides/images/icons/warning.png b/railties/guides/assets/images/icons/warning.png similarity index 100% rename from railties/guides/images/icons/warning.png rename to railties/guides/assets/images/icons/warning.png diff --git a/railties/guides/assets/images/jaimeiniesta.jpg b/railties/guides/assets/images/jaimeiniesta.jpg new file mode 100644 index 0000000000..445f048d92 Binary files /dev/null and b/railties/guides/assets/images/jaimeiniesta.jpg differ diff --git a/railties/guides/images/nav_arrow.gif b/railties/guides/assets/images/nav_arrow.gif similarity index 100% rename from railties/guides/images/nav_arrow.gif rename to railties/guides/assets/images/nav_arrow.gif diff --git a/railties/guides/images/polymorphic.png b/railties/guides/assets/images/polymorphic.png similarity index 100% rename from railties/guides/images/polymorphic.png rename to railties/guides/assets/images/polymorphic.png diff --git a/railties/guides/images/posts_index.png b/railties/guides/assets/images/posts_index.png similarity index 100% rename from railties/guides/images/posts_index.png rename to railties/guides/assets/images/posts_index.png diff --git a/railties/guides/images/rails_guides_logo.gif b/railties/guides/assets/images/rails_guides_logo.gif similarity index 100% rename from railties/guides/images/rails_guides_logo.gif rename to railties/guides/assets/images/rails_guides_logo.gif diff --git a/railties/guides/images/rails_logo_remix.gif b/railties/guides/assets/images/rails_logo_remix.gif similarity index 100% rename from railties/guides/images/rails_logo_remix.gif rename to railties/guides/assets/images/rails_logo_remix.gif diff --git a/railties/guides/images/rails_welcome.png b/railties/guides/assets/images/rails_welcome.png similarity index 100% rename from railties/guides/images/rails_welcome.png rename to railties/guides/assets/images/rails_welcome.png diff --git a/railties/guides/images/session_fixation.png b/railties/guides/assets/images/session_fixation.png similarity index 100% rename from railties/guides/images/session_fixation.png rename to railties/guides/assets/images/session_fixation.png diff --git a/railties/guides/images/tab_grey.gif b/railties/guides/assets/images/tab_grey.gif similarity index 100% rename from railties/guides/images/tab_grey.gif rename to railties/guides/assets/images/tab_grey.gif diff --git a/railties/guides/images/tab_info.gif b/railties/guides/assets/images/tab_info.gif similarity index 100% rename from railties/guides/images/tab_info.gif rename to railties/guides/assets/images/tab_info.gif diff --git a/railties/guides/images/tab_note.gif b/railties/guides/assets/images/tab_note.gif similarity index 100% rename from railties/guides/images/tab_note.gif rename to railties/guides/assets/images/tab_note.gif diff --git a/railties/guides/images/tab_red.gif b/railties/guides/assets/images/tab_red.gif similarity index 100% rename from railties/guides/images/tab_red.gif rename to railties/guides/assets/images/tab_red.gif diff --git a/railties/guides/images/tab_yellow.gif b/railties/guides/assets/images/tab_yellow.gif similarity index 100% rename from railties/guides/images/tab_yellow.gif rename to railties/guides/assets/images/tab_yellow.gif diff --git a/railties/guides/images/tab_yellow.png b/railties/guides/assets/images/tab_yellow.png similarity index 100% rename from railties/guides/images/tab_yellow.png rename to railties/guides/assets/images/tab_yellow.png diff --git a/railties/guides/images/validation_error_messages.png b/railties/guides/assets/images/validation_error_messages.png similarity index 100% rename from railties/guides/images/validation_error_messages.png rename to railties/guides/assets/images/validation_error_messages.png diff --git a/railties/guides/files/javascripts/code_highlighter.js b/railties/guides/assets/javascripts/code_highlighter.js similarity index 100% rename from railties/guides/files/javascripts/code_highlighter.js rename to railties/guides/assets/javascripts/code_highlighter.js diff --git a/railties/guides/files/javascripts/guides.js b/railties/guides/assets/javascripts/guides.js similarity index 100% rename from railties/guides/files/javascripts/guides.js rename to railties/guides/assets/javascripts/guides.js diff --git a/railties/guides/files/javascripts/highlighters.js b/railties/guides/assets/javascripts/highlighters.js similarity index 100% rename from railties/guides/files/javascripts/highlighters.js rename to railties/guides/assets/javascripts/highlighters.js diff --git a/railties/guides/files/stylesheets/main.css b/railties/guides/assets/stylesheets/main.css similarity index 89% rename from railties/guides/files/stylesheets/main.css rename to railties/guides/assets/stylesheets/main.css index 2fd0a2f37e..7ccae2c87e 100644 --- a/railties/guides/files/stylesheets/main.css +++ b/railties/guides/assets/stylesheets/main.css @@ -92,7 +92,7 @@ body { } #header { - background: #c52f24 url(../../images/header_tile.gif) repeat-x; + background: #c52f24 url(../images/header_tile.gif) repeat-x; color: #FFF; padding: 1.5em 0; position: relative; @@ -100,7 +100,7 @@ body { } #feature { - background: #d5e9f6 url(../../images/feature_tile.gif) repeat-x; + background: #d5e9f6 url(../images/feature_tile.gif) repeat-x; color: #333; padding: 0.5em 0 1.5em; } @@ -132,7 +132,7 @@ body { #footer { padding: 2em 0; - background: url(../../images/footer_tile.gif) repeat-x; + background: url(../images/footer_tile.gif) repeat-x; } #footer .wrapper { padding-left: 2em; @@ -179,7 +179,7 @@ a, a:link, a:visited { } #header .nav .index a { - background: #980905 url(../../images/nav_arrow.gif) no-repeat right top; + background: #980905 url(../images/nav_arrow.gif) no-repeat right top; padding-right: 1em; position: relative; z-index: 15; @@ -285,7 +285,7 @@ h6 { #header h1 { float: left; - background: url(../../images/rails_guides_logo.gif) no-repeat; + background: url(../images/rails_guides_logo.gif) no-repeat; width: 297px; text-indent: -9999em; margin: 0; @@ -306,7 +306,7 @@ h6 { #feature ul {margin-left: 0;} #feature ul li { list-style: none; - background: url(../../images/check_bullet.gif) no-repeat left 0.5em; + background: url(../images/check_bullet.gif) no-repeat left 0.5em; padding: 0.5em 1.75em 0.5em 1.75em; font-size: 1.1428em; font-weight: bold; @@ -325,12 +325,12 @@ h6 { font-size: 1.2857em; padding: 0.125em 0 0.25em 0; margin-bottom: 0; - /*background: url(../../images/book_icon.gif) no-repeat left top; + /*background: url(../images/book_icon.gif) no-repeat left top; padding: 0.125em 0 0.25em 28px;*/ } #mainCol dd.ticket, #subCol dd.ticket { - background: #fff9d8 url(../../images/tab_yellow.gif) no-repeat left top; + background: #fff9d8 url(../images/tab_yellow.gif) no-repeat left top; border: none; padding: 1.25em 1em 1.25em 48px; margin-left: 0; @@ -338,7 +338,7 @@ h6 { } #mainCol div.warning, #subCol dd.warning { - background: #f9d9d8 url(../../images/tab_red.gif) no-repeat left top; + background: #f9d9d8 url(../images/tab_red.gif) no-repeat left top; border: none; padding: 1.25em 1.25em 1.25em 48px; margin-left: 0; @@ -355,7 +355,7 @@ h6 { #subCol .chapters ul li { list-style: none; padding: 0 0 0 1em; - background: url(../../images/bullet.gif) no-repeat left 0.45em; + background: url(../images/bullet.gif) no-repeat left 0.45em; margin-left: 0; font-size: 1em; font-weight: normal; @@ -366,7 +366,7 @@ tt { } div.code_container { - background: #EEE url(../../images/tab_grey.gif) no-repeat left top; + background: #EEE url(../images/tab_grey.gif) no-repeat left top; padding: 0.25em 1em 0.5em 48px; } @@ -378,14 +378,14 @@ code { } .note { - background: #fff9d8 url(../../images/tab_note.gif) no-repeat left top; + background: #fff9d8 url(../images/tab_note.gif) no-repeat left top; border: none; padding: 1em 1em 0.25em 48px; margin: 0.25em 0 1.5em 0; } .info { - background: #d5e9f6 url(../../images/tab_info.gif) no-repeat left top; + background: #d5e9f6 url(../images/tab_info.gif) no-repeat left top; border: none; padding: 1em 1em 0.25em 48px; margin: 0.25em 0 1.5em 0; @@ -395,7 +395,7 @@ code { #mainCol ul li { list-style:none; - background: url(../../images/grey_bullet.gif) no-repeat left 0.5em; + background: url(../images/grey_bullet.gif) no-repeat left 0.5em; padding-left: 1em; margin-left: 0; } diff --git a/railties/guides/files/stylesheets/print.css b/railties/guides/assets/stylesheets/print.css similarity index 100% rename from railties/guides/files/stylesheets/print.css rename to railties/guides/assets/stylesheets/print.css diff --git a/railties/guides/files/stylesheets/reset.css b/railties/guides/assets/stylesheets/reset.css similarity index 100% rename from railties/guides/files/stylesheets/reset.css rename to railties/guides/assets/stylesheets/reset.css diff --git a/railties/guides/files/stylesheets/style.css b/railties/guides/assets/stylesheets/style.css similarity index 100% rename from railties/guides/files/stylesheets/style.css rename to railties/guides/assets/stylesheets/style.css diff --git a/railties/guides/files/stylesheets/syntax.css b/railties/guides/assets/stylesheets/syntax.css similarity index 100% rename from railties/guides/files/stylesheets/syntax.css rename to railties/guides/assets/stylesheets/syntax.css diff --git a/railties/guides/rails_guides/generator.rb b/railties/guides/rails_guides/generator.rb index 3d48d6b708..f577182f5f 100644 --- a/railties/guides/rails_guides/generator.rb +++ b/railties/guides/rails_guides/generator.rb @@ -9,27 +9,23 @@ # # Some arguments may be passed via environment variables: # -# WARN_BROKEN_LINKS -# Internal references (anchors) are checked. If a reference is broken -# levenshtein distance is used to suggest an existing one. This is useful -# since IDs are generated by Textile from titles and thus rewordings alter -# them. +# WARNINGS +# If you are writing a guide, please work always with WARNINGS=1. Users can +# generate the guides, and thus this flag is off by default. # -# WARN_DUPLICATE_HEADERS -# Warns about duplicate IDs in headers. Please do resolve them, if any, -# so guides are valid XHTML. +# Internal links (anchors) are checked. If a reference is broken levenshtein +# distance is used to suggest an existing one. This is useful since IDs are +# generated by Textile from headers and thus edits alter them. # -# This check only happens if WARN_BROKEN_LINKS is also active. -# -# EDGE_GUIDES -# Set to "1" to indicate edge guides are generated. +# Also detects duplicated IDs. They happen if there are headers with the same +# text. Please do resolve them, if any, so guides are valid XHTML. # # ALL -# Generate all guides. - +# Set to "1" to force the generation of all guides. +# # ONLY -# If you want to generate only one or a set of guides. -# Prefixes are enough: +# Use ONLY if you want to generate only one or a set of guides. Prefixes are +# enough: # # # generates only association_basics.html # ONLY=assoc ruby rails_guides.rb @@ -39,9 +35,12 @@ # # generates only # ONLY=assoc,migrations ruby rails_guides.rb # -# Note that if you are working on a guide, generation will -# by default process only that one, so ONLY is rarely used -# nowadays. +# Note that if you are working on a guide generation will by default process +# only that one, so ONLY is rarely used nowadays. +# +# EDGE +# Set to "1" to indicate generated guides should be marked as edge. This +# inserts a badge and changes the preamble of the home page. # # --------------------------------------------------------------------------- @@ -85,7 +84,7 @@ module RailsGuides end def set_edge - @edge = ENV['EDGE_GUIDES'] == '1' + @edge = ENV['EDGE'] == '1' end def generate_guides @@ -97,19 +96,18 @@ module RailsGuides def guides_to_generate guides = Dir.entries(source_dir).grep(GUIDES_RE) - ENV.key?("ONLY") ? select_only(guides) : guides + ENV.key?('ONLY') ? select_only(guides) : guides end def select_only(guides) - prefixes = ENV["ONLY"].split(",").map(&:strip) + prefixes = ENV['ONLY'].split(",").map(&:strip) guides.select do |guide| prefixes.any? {|p| guide.start_with?(p)} end end def copy_assets - FileUtils.cp_r(File.join(guides_dir, 'images'), output_dir) - FileUtils.cp_r(File.join(guides_dir, 'files'), output_dir) + FileUtils.cp_r(Dir.glob("#{guides_dir}/assets/*"), output_dir) end def output_file_for(guide) @@ -138,7 +136,7 @@ module RailsGuides result = view.render(:layout => 'layout', :text => textile(body)) - warn_about_broken_links(result) if ENV.key?("WARN_BROKEN_LINKS") + warn_about_broken_links(result) if ENV['WARNINGS'] == '1' end f.write result @@ -229,7 +227,7 @@ module RailsGuides anchors = Set.new html.scan(/
Rails Documentation Team
<%= author('Mike Gunderloy', 'mgunderloy') do %> -Mike Gunderloy is a consultant with ActionRails. He brings 25 years of experience in a variety of languages to bear on his current work with Rails. His near-daily links and other blogging can be found at A Fresh Cup and he twitters too much.
+ Mike Gunderloy is a consultant with ActionRails. He brings 25 years of experience in a variety of languages to bear on his current work with Rails. His near-daily links and other blogging can be found at A Fresh Cup and he twitters too much. <% end %> <%= author('Pratik Naik', 'lifo') do %> -Pratik Naik is a Ruby on Rails consultant with ActionRails and also a member of the Rails core team. He maintains a blog at has_many :bugs, :through => :rails and has an active twitter account.
+ Pratik Naik is a Ruby on Rails consultant with ActionRails and also a member of the Rails core team. He maintains a blog at has_many :bugs, :through => :rails and has an active twitter account. <% end %> <%= author('Xavier Noria', 'fxn', 'fxn.png') do %> -Xavier has been into Rails since 2005, he is currently a Rails consultant. Xavier is Rails committer and enjoys combining his passion for Rails and his past life as a proofreader of math textbooks. Oh, he also tweets and can be found everywhere as "fxn".
+ Xavier has been into Rails since 2005, he is currently a Rails consultant. Xavier is Rails committer and enjoys combining his passion for Rails and his past life as a proofreader of math textbooks. Oh, he also tweets and can be found everywhere as "fxn". <% end %>Rails Guides Designers
<%= author('Jason Zimdars', 'jz') do %> -Jason Zimdars is an experienced creative director and web designer who has lead UI and UX design for numerous websites and web applications. You can see more of his design and writing at Thinkcage.com or follow him on Twitter.
+ Jason Zimdars is an experienced creative director and web designer who has lead UI and UX design for numerous websites and web applications. You can see more of his design and writing at Thinkcage.com or follow him on Twitter. <% end %>Rails Guides Authors
<%= author('Frederick Cheung', 'fcheung') do %> -Frederick Cheung is Chief Wizard at Texperts where he has been using Rails since 2006. He is based in Cambridge (UK) and when not consuming fine ales he blogs at spacevatican.org.
+ Frederick Cheung is Chief Wizard at Texperts where he has been using Rails since 2006. He is based in Cambridge (UK) and when not consuming fine ales he blogs at spacevatican.org. <% end %> <%= author('Tore Darell', 'toretore') do %> -Tore Darell is an independent developer based in Menton, France who specialises in cruft-free web applications using Ruby, Rails and unobtrusive JavaScript. His home on the internet is his blog Sneaky Abstractions.
+ Tore Darell is an independent developer based in Menton, France who specialises in cruft-free web applications using Ruby, Rails and unobtrusive JavaScript. His home on the internet is his blog Sneaky Abstractions. <% end %> <%= author('Jeff Dean', 'zilkey') do %> -Jeff Dean is a software engineer with Pivotal Labs.
+ Jeff Dean is a software engineer with Pivotal Labs. <% end %> <%= author('Cássio Marques', 'cmarques') do %> -Cássio Marques is a Brazilian software developer working with different programming languages such as Ruby, JavaScript, CPP and Java, as an independent consultant. He blogs at /* CODIFICANDO */, which is mainly written in Portuguese, but will soon get a new section for posts with English translation. + Cássio Marques is a Brazilian software developer working with different programming languages such as Ruby, JavaScript, CPP and Java, as an independent consultant. He blogs at /* CODIFICANDO */, which is mainly written in Portuguese, but will soon get a new section for posts with English translation. <% end %> <%= author('James Miller', 'bensie') do %> -
James Miller is a software developer for JK Tech in San Diego, CA. Find me on GitHub, Gmail, Twitter, and Freenode as "bensie".
+ James Miller is a software developer for JK Tech in San Diego, CA. Find me on GitHub, Gmail, Twitter, and Freenode as "bensie". <% end %> <%= author('Emilio Tagua', 'miloops') do %> -Emilio Tagua —a.k.a. miloops— is an Argentinian entrepreneur, developer, open source contributor and Rails evangelist. Cofounder of Eventioz. He has been using Rails since 2006 and contributing since early 2008. Can be found at gmail, twitter, freenode, everywhere as "miloops".
+ Emilio Tagua —a.k.a. miloops— is an Argentinian entrepreneur, developer, open source contributor and Rails evangelist. Cofounder of Eventioz. He has been using Rails since 2006 and contributing since early 2008. Can be found at gmail, twitter, freenode, everywhere as "miloops". <% end %> <%= author('Heiko Webers', 'hawe') do %> -Heiko Webers is the founder of bauland42, a German web application security consulting and development company focused on Ruby on Rails. He blogs at the Ruby on Rails Security Project. After 10 years of desktop application development, Heiko has rarely looked back.
+ Heiko Webers is the founder of bauland42, a German web application security consulting and development company focused on Ruby on Rails. He blogs at the Ruby on Rails Security Project. After 10 years of desktop application development, Heiko has rarely looked back. <% end %> <%= author('Mikel Lindsaar', 'raasdnil') do %> -Mikel Lindsaar has been working with Rails since 2006 and is the author of the Ruby Mail gem and core contributor (he helped re-write Action Mailer's API). Mikel has a blog and tweets. + Mikel Lindsaar has been working with Rails since 2006 and is the author of the Ruby Mail gem and core contributor (he helped re-write Action Mailer's API). Mikel has a blog and tweets. +<% end %> + +
Rails Guides Reviewers
+ +<%= author('Jaime Iniesta', 'jaimeiniesta', 'jaimeiniesta.jpg') do %> + Jaime Iniesta works as a Ruby on Rails freelance developer since 2005. He's a member of ProRuby, co-founder of the Spanish Ruby Users Group, member of Spain.rb, and organizer of Conferencia Rails and EuRuKo 2009. Jaime has a blog and tweets. <% end %> diff --git a/railties/guides/source/debugging_rails_applications.textile b/railties/guides/source/debugging_rails_applications.textile index cd0098d686..3eddf1a2b1 100644 --- a/railties/guides/source/debugging_rails_applications.textile +++ b/railties/guides/source/debugging_rails_applications.textile @@ -286,7 +286,7 @@ condition down finish list ps save thread var continue edit frame method putl set tmate where -TIP: To view the help menu for any command use +help++gem install rails rails yaffle_guide cd yaffle_guide rails generate scaffold bird name:string rake db:migrate rails server -
++ To get more detailed help on the plugin generator, type +rails generate plugin+. Later on this guide will describe how to work with generators, so go ahead and generate your plugin with the +--with-generator+ option now: -rails generate plugin yaffle rails generate plugin yaffle --with-generator -
++ You should see the following output: -rails generate plugin yaffle --with-generator -
++ h4. Organize Your Files To make it easy to organize your files and to make the plugin more compatible with GemPlugins, start out by altering your file system to look like this: -create vendor/plugins/yaffle/lib create vendor/plugins/yaffle/tasks create vendor/plugins/yaffle/test @@ -89,20 +89,20 @@ create vendor/plugins/yaffle/generators/yaffle create vendor/plugins/yaffle/generators/yaffle/templates create vendor/plugins/yaffle/generators/yaffle/yaffle_generator.rb create vendor/plugins/yaffle/generators/yaffle/USAGE -
++ *vendor/plugins/yaffle/init.rb* @@ -124,7 +124,7 @@ h4. Test Setup *vendor/plugins/yaffle/test/database.yml:* -|-- lib | |-- yaffle | `-- yaffle.rb `-- rails | `-- init.rb -
++ For this guide you'll need 2 tables/models, Hickwalls and Wickwalls, so add the following: @@ -239,10 +239,10 @@ end To run this, go to the plugin directory and run +rake+: -sqlite: :adapter: sqlite :dbfile: vendor/plugins/yaffle/test/yaffle_plugin.sqlite.db @@ -146,7 +146,7 @@ mysql: :username: root :password: password :database: yaffle_plugin_test -
++ You should see output like: @@ -1511,4 +1511,5 @@ h3. Changelog "Lighthouse ticket":http://rails.lighthouseapp.com/projects/16213/tickets/32-update-plugins-guide +* April 4, 2010: Fixed document to validate XHTML 1.0 Strict. "Jaime Iniesta":credits.html#jaimeiniesta * November 17, 2008: Major revision by Jeff Dean diff --git a/railties/guides/source/routing.textile b/railties/guides/source/routing.textile index 6625412684..0cf8c45761 100644 --- a/railties/guides/source/routing.textile +++ b/railties/guides/source/routing.textile @@ -65,7 +65,7 @@ RESTful routes take advantage of the built-in REST orientation of Rails to wrap resources :books -h4. Named Routes +h4(#quick-tour-named-routes). Named Routes Named routes give you very readable links in your code, as well as handling incoming requests. Here's a typical named route: @@ -91,7 +91,7 @@ resources :assemblies do end -h4. Regular Routes +h4(#quick-tour-regular-routes). Regular Routes In many applications, you'll also see non-RESTful routing, which explicitly connects the parts of a URL to a particular action. For example, @@ -400,7 +400,7 @@ In addition to the routes for magazines, this declaration will also create route This will also create routing helpers such as +magazine_ads_url+ and +edit_magazine_ad_path+. -h5. Using +:name_prefix+ +h5(#nested-name-prefix). Using +:name_prefix+ The +:name_prefix+ option overrides the automatically-generated prefix in nested route helpers. For example, diff --git a/railties/guides/source/security.textile b/railties/guides/source/security.textile index b62ff8cb38..1ddf094d18 100644 --- a/railties/guides/source/security.textile +++ b/railties/guides/source/security.textile @@ -611,7 +611,7 @@ h4. SQL Injection -- _Thanks to clever methods, this is hardly a problem in most Rails applications. However, this is a very devastating and common attack in web applications, so it is important to understand the problem._ -h5. Introduction +h5(#sql-injection-introduction). Introduction SQL injection attacks aim at influencing database queries by manipulating web application parameters. A popular goal of SQL injection attacks is to bypass authorization. Another goal is to carry out data manipulation or reading arbitrary data. Here is an example of how not to use user input data in a query: @@ -668,7 +668,7 @@ The result won't be a list of projects (because there is no project with an empt Also, the second query renames some columns with the AS statement so that the web application displays the values from the user table. Be sure to update your Rails "to at least 2.1.1":http://www.rorsecurity.info/2008/09/08/sql-injection-issue-in-limit-and-offset-parameter/. -h5. Countermeasures +h5(#sql-injection-countermeasures). Countermeasures Ruby on Rails has a built in filter for special SQL characters, which will escape ' , " , NULL character and line breaks. Using +Model.find(id)+ or +Model.find_by_some thing(something)+ automatically applies this countermeasure. But in SQL fragments, especially in conditions fragments (+:conditions => "..."+), the +connection.execute()+ or +Model.find_by_sql()+ methods, it has to be applied manually. @@ -760,7 +760,7 @@ http://www.cbsnews.com/stories/2002/02/15/weather_local/main501644.shtml?zipcodecd vendor/plugins/yaffle rake -