Hi all I'm wondering how I might go about this...I am building a laravel4 application and I would like to call a function in my controller that deletes all of the selected Items in the list.
This is my view
<div class="panel panel-default">
<div class="panel-heading">
Twitter Winners
<div class="pull-right btn-toolbar">
<a href="{{action('AdminBaseController@deleteSelectedTweets')}}" class="btn btn-danger">Delete Selected</a>
<a href="#" class="btn btn-primary">Confirm Winners</a>
<a href="#" class="btn btn-primary">Generate New List</a>
</div>
</div>
<div class="panel-body">
<table class="table table-hover">
<thead>
<tr>
<th>Delete</th>
<th>Tweet</th>
<th>Username</th>
<th>Name</th>
<th>To</th>
<th>From</th>
</tr>
</thead>
@foreach(Tweet::all() as $tweet)
<tr>
<td><input type="checkbox" name="delete_tweet" value="0"/></td>
<td>{{$tweet->tweet_text}}</td>
<td>{{$tweet->screen_name}}</td>
<td>{{$tweet->name}}</td>
<td><select name="origin">
<option value="0">Origin...</option>
<option value="1">Station 1</option>
<option value="2">Station 2</option>
<option value="3">Station 3</option>
</select>
</td>
<td>
<select name="destination">
<option value="0">Destination...</option>
<option value="1">Station 1</option>
<option value="2">Station 2</option>
<option value="3">Station 3</option>
</select>
</td>
</tr>
@endforeach
</table>
</div>
</div>
Ideall I'd like to execute the function when the user selects this link:
<a href="{{action('AdminBaseController@deleteSelectedTweets')}}" class="btn btn-danger">Delete Selected</a>
I don't want to navigate away from the page and that is the only way I see being able to do it.