Skip to content

Commit

Permalink
Added a create segment link on segments page.
Browse files Browse the repository at this point in the history
  • Loading branch information
Doug Youch committed May 20, 2010
1 parent 385b7da commit 5f90d19
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 2 additions & 3 deletions app/controllers/members_controller.rb
Expand Up @@ -192,11 +192,10 @@ def segments
def create_segment
cms_page_path ['People', 'Segments'], 'Create a Segment'

@segment = UserSegment.new params[:segment]
@segment = UserSegment.new :main_page => true

if request.post? && params[:segment]
@segment.save
if @segment.id
if @segment.update_attributes params[:segment]
@segment.refresh
redirect_to :action => 'segments'
end
Expand Down
8 changes: 6 additions & 2 deletions app/views/members/segments.html.erb
@@ -1,9 +1,13 @@
<% action_panel :handler => 'members' do |p| -%>
<%= p.link "Create a Segment",:icon => 'add.gif', :action => 'create_segment' %>
<% end -%>

<hr/>

<script>
<%= active_table_javascript %>
</script>

<br />

<div id='user_segments_table'>
<%= render :partial => 'user_segments_table' %>
</div>

0 comments on commit 5f90d19

Please sign in to comment.