我创建了欢迎控制器和更新的路径文件
public class LocationSearchFragment extends PlaceAutocompleteFragment implements
GoogleApiClient.OnConnectionFailedListener,
PlaceSelectionListener {
public static final String TAG="Location Search:";
private GoogleApiClient mGoogleApiClient;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setOnPlaceSelectedListener(this);
}
@Override
public void onPlaceSelected(Place place) {
Toast.makeText(getActivity(),
place.getName(),Toast.LENGTH_SHORT).show();
}
@Override
public void onError(Status status) {
Toast.makeText(getActivity() ,
status.toString(),Toast.LENGTH_SHORT).show();
}
@Override
public void onConnectionFailed(ConnectionResult result) {
}
@Override
public void onAttach(Activity activity) {
mGoogleApiClient = new GoogleApiClient
.Builder(activity)
.addApi(Places.GEO_DATA_API)
.addApi(Places.PLACE_DETECTION_API)
.build();
}
}

但是我收到了这个错误。
答案 0 :(得分:1)
你的root
并没有真正映射到某个地方。假设您有welcome_controller
和方法index
,请执行:
Rails.application.routes.draw do
root :to => 'welcome#index'
get 'welcome/index'
end
我看了你的照片,发现错误发生在stylesheet_link_tag
。您可能在application
文件夹中没有名为vendor/assets/stylesheets
的文件/文件夹。因此,请删除该行或将文件名更改为vendor/assets/
。