Sha256: 6d55c77bd950aab38805597905e5a38229364ea3184194ef52034f86172b0603
Contents?: true
Size: 1.56 KB
Versions: 8
Compression:
Stored size: 1.56 KB
Contents
= effective_form_with(model: post, url: post.persisted? ? effective_posts.post_path(post.id) : effective_posts.posts_path) do |f| = f.text_field :title, hint: 'The title of your post.' - if f.object.persisted? || f.object.errors.include?(:slug) - current_url = effective_posts.post_path(f.object) = f.text_field :slug, hint: "The slug controls this post's internet address. Be careful, changing the slug will break links that other websites may have to the old address.<br>#{('This post is currently reachable via ' + link_to(current_url.gsub(f.object.slug, '<strong>' + f.object.slug + '</strong>').html_safe, current_url)) if current_url && f.object.slug.present? }".html_safe - if Array(EffectivePosts.categories).length > 1 = f.select :category, EffectivePosts.categories - else = f.hidden_field :category, (EffectivePosts.categories.first || 'posts') - if EffectivePosts.use_active_storage = f.file_field :image, hint: 'An image for your post' = f.ck_editor :excerpt, hint: 'Will be used for the post excerpt on index pages.' = f.text_field :description, hint: 'The content of the post meta tags.', maxlength: 150 = render partial: '/effective/posts/additional_fields', locals: { post: post, form: f, f: f } = f.datetime_field :published_at, label: 'Publish date', hint: 'When should this be displayed on the website.' = f.check_box :draft, hint: 'Save this post as a draft. It will not be accessible on the website.' - unless EffectivePosts.use_fullscreen_editor = f.ck_editor :body, hint: 'The content of your post.' = f.submit 'Save'
Version data entries
8 entries across 8 versions & 1 rubygems